You are here

function drush_deploy_empty_plan in Deploy - Content Staging 7.3

Command callback for emptying a deployment plan.

File

./deploy.drush.inc, line 247
Provides Drush integration for Deploy.

Code

function drush_deploy_empty_plan($name) {
  $plan = deploy_plan_load($name);
  if (FALSE === $plan) {
    return drush_set_error(dt("Plan '@name' doesn't exist.", array(
      '@name' => $name,
    )));
  }
  if (!$plan
    ->emptyPlan()) {
    return drush_set_error(dt("Unable to empty plan '@name' at this time.", array(
      '@name' => $name,
    )));
  }
  drush_print(dt("Plan '@name' has been emptied.", array(
    '@name' => $name,
  )));
  return DRUSH_SUCCESS;
}