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}");