From 59f8255166874a3f3485891a6bdba1aef6a6ec3a Mon Sep 17 00:00:00 2001 From: Pablo Lopez Date: Tue, 24 Sep 2024 11:02:49 +0200 Subject: [PATCH 1/3] Ensure that .drainpipe/gitlab directory is present --- src/ScaffoldInstallerPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index 21b5b2efc..a1bba6994 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -245,6 +245,7 @@ private function installCICommands(): void private function installGitlabCI(string $scaffoldPath): void { $fs = new Filesystem(); $fs->removeDirectory('./.drainpipe/gitlab'); + $fs->ensureDirectoryExists('./.drainpipe/gitlab'); if (!isset($this->extra['drainpipe']['gitlab']) || !is_array($this->extra['drainpipe']['gitlab'])) { return; @@ -256,7 +257,6 @@ private function installGitlabCI(string $scaffoldPath): void { $this->io->write("🪠 [Drainpipe] .gitlab/drainpipe/DDEV.gitlab-ci.yml installed"); } else { - $fs->ensureDirectoryExists('./.drainpipe/gitlab'); $fs->copy("$scaffoldPath/gitlab/Common.gitlab-ci.yml", ".drainpipe/gitlab/Common.gitlab-ci.yml"); $this->io->write("🪠 [Drainpipe] .drainpipe/gitlab/Common.gitlab-ci.yml installed"); } @@ -266,7 +266,7 @@ private function installGitlabCI(string $scaffoldPath): void { foreach ($this->extra['drainpipe']['gitlab'] as $gitlab) { $file = "gitlab/$gitlab.gitlab-ci.yml"; - if (file_exists("$scaffoldPath/$file")) {$fs->ensureDirectoryExists('./.drainpipe/gitlab'); + if (file_exists("$scaffoldPath/$file")) { $fs->copy("$scaffoldPath/$file", ".drainpipe/$file"); $this->io->write("🪠 [Drainpipe] .drainpipe/$file installed"); } From 8e7e46c9dd0c84dc9ba834e20d8ef8b2b928be94 Mon Sep 17 00:00:00 2001 From: Pablo Lopez Date: Tue, 24 Sep 2024 11:07:28 +0200 Subject: [PATCH 2/3] Update ScaffoldInstallerPlugin.php --- src/ScaffoldInstallerPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index a1bba6994..39b74de8e 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -245,12 +245,12 @@ private function installCICommands(): void private function installGitlabCI(string $scaffoldPath): void { $fs = new Filesystem(); $fs->removeDirectory('./.drainpipe/gitlab'); - $fs->ensureDirectoryExists('./.drainpipe/gitlab'); - + if (!isset($this->extra['drainpipe']['gitlab']) || !is_array($this->extra['drainpipe']['gitlab'])) { return; } + $fs->ensureDirectoryExists('./.drainpipe/gitlab'); if (file_exists('./.ddev/config.yaml')) { $fs->ensureDirectoryExists('.gitlab/drainpipe'); $fs->copy("$scaffoldPath/gitlab/DDEV.gitlab-ci.yml", ".gitlab/drainpipe/DDEV.gitlab-ci.yml"); From f3e1f305f36438b1deb7a860308a7772fa00facc Mon Sep 17 00:00:00 2001 From: Pablo Lopez Date: Tue, 24 Sep 2024 11:08:25 +0200 Subject: [PATCH 3/3] Update ScaffoldInstallerPlugin.php --- src/ScaffoldInstallerPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScaffoldInstallerPlugin.php b/src/ScaffoldInstallerPlugin.php index 39b74de8e..93f987584 100644 --- a/src/ScaffoldInstallerPlugin.php +++ b/src/ScaffoldInstallerPlugin.php @@ -245,7 +245,7 @@ private function installCICommands(): void private function installGitlabCI(string $scaffoldPath): void { $fs = new Filesystem(); $fs->removeDirectory('./.drainpipe/gitlab'); - + if (!isset($this->extra['drainpipe']['gitlab']) || !is_array($this->extra['drainpipe']['gitlab'])) { return; }