Commit 29be87cb authored by Adrian Rossouw's avatar Adrian Rossouw

Make it possible for the hosting-task command to accept an alias and an task type as a param.

ie: drush @hostmaster hosting-task @site.com verify

Instead of having to look up the nid the whole time.

this is only used to make debugging simpler, not by the dispatcher.
parent 04ba1c72
......@@ -13,12 +13,19 @@ function _hosting_task_log($entry) {
}
}
function drush_hosting_task_validate($task) {
function drush_hosting_task_validate($id, $type = null) {
drush_set_option('user', 1);
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_LOGIN);
if (is_numeric($task)) {
$task = node_load($task);
if (is_numeric($id)) {
$task = node_load($id);
}
elseif (is_string($id) && isset($type)) {
$ref = hosting_context_load($id);
if (!($task = hosting_get_most_recent_task($ref->nid, $type))) {
$task = hosting_add_task($ref->nid, $type);
}
}
if ($task->type == 'task') {
$task->ref = node_load($task->rid);
$task->options = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment