force=1 only affects filtered branches

This commit is contained in:
Damian Mooyman 2016-06-27 17:09:20 +12:00
parent 6604109f31
commit 055888bf71
1 changed files with 6 additions and 6 deletions

View File

@ -49,12 +49,6 @@ class RefreshMarkdownTask extends BuildTask
foreach ($repositories as list($repo, $folder, $branch)) {
$path = "{$baseDir}/{$folder}_{$branch}";
// Pass in ?force=1 to force delete existing repos, rather than trying to update them
if($this->request && $this->request->getVar('force') && file_exists($path)) {
$this->printLine("Removing {$path}");
Filesystem::removeFolder($path);
}
// Pass in ?addonly=1 to only update new branches
if($this->request && $this->request->getVar('addonly') && file_exists($path)) {
$this->printLine("Skipping update of {$branch}: Already exists at {$path};");
@ -67,6 +61,12 @@ class RefreshMarkdownTask extends BuildTask
continue;
}
// Pass in ?force=1 to force delete existing repos, rather than trying to update them
if($this->request && $this->request->getVar('force') && file_exists($path)) {
$this->printLine("Removing {$path}");
Filesystem::removeFolder($path);
}
// Update this repo
$this->printLine("Beginning update of {$branch}");
$errors = $updater->update($repo, $path, $branch);