33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2025-01-13 10:25:31 +00:00

Fixed deleting files from master.

This commit is contained in:
datsepp 2019-09-11 13:57:14 +02:00
parent 84cb1b369b
commit b5bd81143e
2 changed files with 15 additions and 5 deletions

View File

@ -75,7 +75,7 @@ abstract class Helper
$options = new Registry;
// Set CI server address for the request
$options->set('server.url', 'https://stuff.gramma.name');
$options->set('server.url', 'https://joomla-dev.lukaskimpel.com');
// Set name of the zip archive
$options->set('zip.name', 'build.zip');

View File

@ -187,8 +187,17 @@ class PullModel extends AbstractModel
$github = Helper::initializeGithub();
// retrieve pullData for sha later on.
try
{
$pull = $this->retrieveGitHubData($github, $id);
$sha = $pull->head->sha;
}
catch (\RuntimeException $e)
{
// Catch the Exception and continue, because the hash is not that
// necessary for applying patches
$sha = "Error:429";
}
// Create tmp folder if it does not exist
if (!file_exists($ciSettings->get('folder.temp')))
@ -241,6 +250,7 @@ class PullModel extends AbstractModel
// get files from deleted_logs
$deletedFiles = file($delLogPath);
$deletedFiles = array_map('trim', $deletedFiles);
// remove deleted_logs to avoid get listing afterwards
File::delete($delLogPath);
@ -257,7 +267,7 @@ class PullModel extends AbstractModel
{
try
{
$filePath = explode("\\", $file);
$filePath = explode("\\", Path::clean($file));
array_pop($filePath);
$filePath = implode("\\", $filePath);
@ -301,7 +311,7 @@ class PullModel extends AbstractModel
// Clear temp folder and store applied patch in database
Folder::delete($tempPath);
$this->saveAppliedPatch($id, $files);
$this->saveAppliedPatch($id, $files, $sha);
// Change the media version
$version = new Version;