Skip to content

Commit

Permalink
Put confirmation in if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Apr 25, 2023
1 parent 4aa9a2e commit 5a464c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/publications/src/Commands/MakePublicationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ protected function handleEmptyMediaFilesCollection(PublicationFieldDefinition $f
$this->newLine();
$this->warn("<fg=red>Warning:</> $message");
// TODO Ask to pick from root media directory?
if ($this->confirm('Would you like to skip this field?', true)) {
return null;
if (! count($filesInRootMediaDirectory)) {
if ($this->confirm('Would you like to skip this field?', true)) {
return null;
}
}

throw new InvalidArgumentException('Unable to locate any media files for this publication type');
Expand Down

0 comments on commit 5a464c5

Please sign in to comment.