function drush_hacked_drush_command_validate in Hacked! 8.2
Same name and namespace in other branches
- 6.2 hacked.drush.inc \drush_hacked_drush_command_validate()
- 7.2 hacked.drush.inc \drush_hacked_drush_command_validate()
Validate hook for the hacked drush commands that need a project.
Parameters
string $short_name: The project short name.
2 calls to drush_hacked_drush_command_validate()
- drush_hacked_details_validate in ./
hacked.drush.inc - Validate hook for the hacked_details drush command.
- drush_hacked_diff_validate in ./
hacked.drush.inc - Validate hook for the hacked_diff drush command.
File
- ./
hacked.drush.inc, line 276 - Hacked drush command.
Code
function drush_hacked_drush_command_validate($short_name = '') {
if (empty($short_name)) {
return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('A valid project must be specified', [
'@project' => $short_name,
]));
}
$project = new hackedProject($short_name);
$project
->identify_project();
if (!$project->project_identified) {
return drush_set_error('HACKED_PROJECT_NOT_FOUND', dt('Could not find project: @project', [
'@project' => $short_name,
]));
}
$project = NULL;
}