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:
parent
84cb1b369b
commit
b5bd81143e
@ -75,7 +75,7 @@ abstract class Helper
|
|||||||
$options = new Registry;
|
$options = new Registry;
|
||||||
|
|
||||||
// Set CI server address for the request
|
// 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
|
// Set name of the zip archive
|
||||||
$options->set('zip.name', 'build.zip');
|
$options->set('zip.name', 'build.zip');
|
||||||
|
@ -187,8 +187,17 @@ class PullModel extends AbstractModel
|
|||||||
$github = Helper::initializeGithub();
|
$github = Helper::initializeGithub();
|
||||||
|
|
||||||
// retrieve pullData for sha later on.
|
// retrieve pullData for sha later on.
|
||||||
$pull = $this->retrieveGitHubData($github, $id);
|
try
|
||||||
$sha = $pull->head->sha;
|
{
|
||||||
|
$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
|
// Create tmp folder if it does not exist
|
||||||
if (!file_exists($ciSettings->get('folder.temp')))
|
if (!file_exists($ciSettings->get('folder.temp')))
|
||||||
@ -241,6 +250,7 @@ class PullModel extends AbstractModel
|
|||||||
|
|
||||||
// get files from deleted_logs
|
// get files from deleted_logs
|
||||||
$deletedFiles = file($delLogPath);
|
$deletedFiles = file($delLogPath);
|
||||||
|
$deletedFiles = array_map('trim', $deletedFiles);
|
||||||
|
|
||||||
// remove deleted_logs to avoid get listing afterwards
|
// remove deleted_logs to avoid get listing afterwards
|
||||||
File::delete($delLogPath);
|
File::delete($delLogPath);
|
||||||
@ -257,7 +267,7 @@ class PullModel extends AbstractModel
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$filePath = explode("\\", $file);
|
$filePath = explode("\\", Path::clean($file));
|
||||||
array_pop($filePath);
|
array_pop($filePath);
|
||||||
$filePath = implode("\\", $filePath);
|
$filePath = implode("\\", $filePath);
|
||||||
|
|
||||||
@ -301,7 +311,7 @@ class PullModel extends AbstractModel
|
|||||||
// Clear temp folder and store applied patch in database
|
// Clear temp folder and store applied patch in database
|
||||||
Folder::delete($tempPath);
|
Folder::delete($tempPath);
|
||||||
|
|
||||||
$this->saveAppliedPatch($id, $files);
|
$this->saveAppliedPatch($id, $files, $sha);
|
||||||
|
|
||||||
// Change the media version
|
// Change the media version
|
||||||
$version = new Version;
|
$version = new Version;
|
||||||
|
Loading…
Reference in New Issue
Block a user