From 5209a3db594d6788e273eaa853c8571a7398a358 Mon Sep 17 00:00:00 2001 From: Thibaut Cheymol Date: Thu, 4 Jan 2024 16:45:03 +0100 Subject: [PATCH] :bug: [Commands] Fix bug commands creating config file anyways --- src/Command/DeployCommand.php | 4 ++++ src/Command/RollbackCommand.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Command/DeployCommand.php b/src/Command/DeployCommand.php index e3fdb08..eb0f3d6 100644 --- a/src/Command/DeployCommand.php +++ b/src/Command/DeployCommand.php @@ -59,11 +59,15 @@ protected function initialize(InputInterface $input, OutputInterface $output): v if (null !== $customConfigPath && is_readable($customConfigPath)) { $this->configFilePath = $customConfigPath; + + return; } $defaultConfigPath = SymfonyConfigPathGuesser::guess($this->projectDir, $input->getArgument('stage')); if (is_readable($defaultConfigPath)) { $this->configFilePath = $defaultConfigPath; + + return; } $this->createDefaultConfigFile($input, $output, $defaultConfigPath, $input->getArgument('stage')); diff --git a/src/Command/RollbackCommand.php b/src/Command/RollbackCommand.php index d6c4be5..c233615 100644 --- a/src/Command/RollbackCommand.php +++ b/src/Command/RollbackCommand.php @@ -54,11 +54,15 @@ protected function initialize(InputInterface $input, OutputInterface $output): v if (null !== $customConfigPath && is_readable($customConfigPath)) { $this->configFilePath = $customConfigPath; + + return; } $defaultConfigPath = SymfonyConfigPathGuesser::guess($this->projectDir, $input->getArgument('stage')); if (is_readable($defaultConfigPath)) { $this->configFilePath = $defaultConfigPath; + + return; } throw new \RuntimeException(sprintf("The default configuration file does not exist or it's not readable, and no custom configuration file was given either. Create the '%s' configuration file and run this command again.", $defaultConfigPath));