Skip to content

Commit

Permalink
Add warning on missing options
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebowczyk committed Nov 1, 2024
1 parent fabf806 commit 70fb8e6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src-setup/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 70fb8e6

Please sign in to comment.