From 70fb8e6bf3d2943aecc5073631a65c8aa11b9754 Mon Sep 17 00:00:00 2001 From: ddebowczyk Date: Fri, 1 Nov 2024 10:02:29 +0100 Subject: [PATCH] Add warning on missing options --- src-setup/PublishCommand.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src-setup/PublishCommand.php b/src-setup/PublishCommand.php index 5944e4a0..924d80ee 100644 --- a/src-setup/PublishCommand.php +++ b/src-setup/PublishCommand.php @@ -43,6 +43,21 @@ protected function initialize(InputInterface $input, OutputInterface $output): v $this->filesystem = new Filesystem($this->noOp, $this->output); $this->envFile = new EnvFile($this->noOp, $this->output, $this->filesystem); + $missingOptions = []; + if (!$input->getOption('target-config-dir')) { + $missingOptions[] = '--target-config-dir'; + } + if (!$input->getOption('target-prompts-dir')) { + $missingOptions[] = '--target-prompts-dir'; + } + if (!$input->getOption('target-env-file')) { + $missingOptions[] = '--target-env-file'; + } + + if (!empty($missingOptions)) { + throw new InvalidArgumentException('Missing required options: ' . implode(', ', $missingOptions)); + } + // Ensure the command is run from the project root $projectRoot = getcwd(); if (!file_exists($projectRoot . '/composer.json')) {