From 9f5d1282470769d2af1787ab7c50b22e0a161a51 Mon Sep 17 00:00:00 2001 From: Adam Malone Date: Fri, 20 Nov 2020 11:12:23 +1100 Subject: [PATCH] Switches logic in setup to prevent asking questions twice. --- src/Commands/SetupCommand.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Commands/SetupCommand.php b/src/Commands/SetupCommand.php index d0db59f..cb6de65 100644 --- a/src/Commands/SetupCommand.php +++ b/src/Commands/SetupCommand.php @@ -33,18 +33,14 @@ public function setup(Config $config) foreach ($configFiles as $type => $location) { $this->yell(sprintf('%s configuration (%s)', ucfirst($type), $location)); - if ( - file_exists($location) && $this->confirm( - sprintf('Would you like to regenerate the %s configuration file', $type) - ) - ) { - $this->createConfigYaml($location); - } elseif ( - $this->confirm( - sprintf('%s configuration file not found. Would you like to add one?', ucfirst($type)) - ) - ) { - $this->createConfigYaml($location); + if (file_exists($location)) { + if ($this->confirm(sprintf('Would you like to regenerate the %s configuration file', $type))) { + $this->createConfigYaml($location); + } + } else { + if ($this->confirm(sprintf('%s configuration file not found. Would you like to add one?', ucfirst($type)))) { + $this->createConfigYaml($location); + } } } } @@ -112,7 +108,6 @@ private function createConfigYaml($location) 'format' => 'Y-m-d H:i:s', 'taskwait' => 5, 'timeout' => 300, - 'configsyncdir' => 'sync', ], ];