From ceff1fbd91d7789e607474e9b37bebf1be59eaa5 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 2 Jul 2024 14:24:20 +1000 Subject: [PATCH 1/2] Make Moodle Install Clone step optional --- src/Installer/MoodleInstaller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Installer/MoodleInstaller.php b/src/Installer/MoodleInstaller.php index 8a01e628..ac86608f 100644 --- a/src/Installer/MoodleInstaller.php +++ b/src/Installer/MoodleInstaller.php @@ -66,7 +66,9 @@ public function install(): void $this->moodle->directory, ]; - $this->execute->mustRun(new Process($cmd, null, null, null, null)); + if (!is_dir($this->moodle->directory)) { + $this->execute->mustRun(new Process($cmd, null, null, null, null)); + } // Expand the path to Moodle so all other installers use absolute path. $this->moodle->directory = $this->expandPath($this->moodle->directory); From c6a4f18ac20072c9292caefc07498cf6e7cb4904 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 2 Jul 2024 14:39:53 +1000 Subject: [PATCH 2/2] Add comment --- src/Installer/MoodleInstaller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Installer/MoodleInstaller.php b/src/Installer/MoodleInstaller.php index ac86608f..45ad3149 100644 --- a/src/Installer/MoodleInstaller.php +++ b/src/Installer/MoodleInstaller.php @@ -66,6 +66,7 @@ public function install(): void $this->moodle->directory, ]; + // Only run git clone if it does not already exist if (!is_dir($this->moodle->directory)) { $this->execute->mustRun(new Process($cmd, null, null, null, null)); }