diff --git a/app/code/RefreshMarkdownTask.php b/app/code/RefreshMarkdownTask.php index 9182ca0..18232ff 100644 --- a/app/code/RefreshMarkdownTask.php +++ b/app/code/RefreshMarkdownTask.php @@ -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);