From 7fdac9b4d36a0278f4b396a336e76974a39e8aaf Mon Sep 17 00:00:00 2001 From: Mike Andrewartha Date: Wed, 10 Feb 2016 09:55:31 +1300 Subject: [PATCH] rename crontask, update task to clear the module before cloning to get the latest markdown --- .../{UpdateDocsCronTask.php => DocsCronTask.php} | 2 +- app/code/UpdateTask.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) rename app/code/{UpdateDocsCronTask.php => DocsCronTask.php} (87%) diff --git a/app/code/UpdateDocsCronTask.php b/app/code/DocsCronTask.php similarity index 87% rename from app/code/UpdateDocsCronTask.php rename to app/code/DocsCronTask.php index 55ea5ae..7e5c3b6 100644 --- a/app/code/UpdateDocsCronTask.php +++ b/app/code/DocsCronTask.php @@ -1,6 +1,6 @@ printLine("cloning " . $remote . "/" . $branch); - - chdir("{$path}/src"); - exec("git clone -q git://github.com/{$remote}.git {$folder}_{$branch} --quiet"); + if (file_exists("{$path}/src/{$folder}_{$branch}")) { + exec("rm -rf {$path}/src/{$folder}_{$branch}"); } + $this->printLine("cloning " . $remote . "/" . $branch); + + chdir("{$path}/src"); + exec("git clone -q git://github.com/{$remote}.git {$folder}_{$branch} --quiet"); + chdir("{$path}/src/{$folder}_{$branch}"); exec("git fetch origin"); exec("git checkout -q origin/{$branch}");