Skip to content

Commit

Permalink
Do not fail file-exists validation if the specified parameter contain…
Browse files Browse the repository at this point in the history
…ing the file path is empty.
  • Loading branch information
greg-1-anderson committed Dec 29, 2016
1 parent 1b123f1 commit a962c76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Drush/Commands/ValidatorsCommands.php
Expand Up @@ -29,7 +29,7 @@ public function validateEntityLoad(CommandData $commandData) {

/**
* Validate that the file path exists.
*
* @hook validate @validate-file-exists
* @param \Consolidation\AnnotatedCommand\CommandData $commandData
* @return \Consolidation\AnnotatedCommand\CommandError|null
Expand All @@ -38,7 +38,7 @@ public function validateFileExists(CommandData $commandData) {
$arg_names = _convert_csv_to_array($commandData->annotationData()->get('validate-file-exists', NULL));
foreach ($arg_names as $arg_name) {
$path = $commandData->input()->getArgument($arg_name);
if (!file_exists($path)) {
if (!empty($path) && !file_exists($path)) {
$missing[] = $path;
}
}
Expand All @@ -49,4 +49,4 @@ public function validateFileExists(CommandData $commandData) {
}
}

}
}

0 comments on commit a962c76

Please sign in to comment.