You are here

function drush_git_deploy_download in Git Deploy 6

Same name and namespace in other branches
  1. 7 git_deploy.drush.inc \drush_git_deploy_download()

A command callback. Downloads the glip library using Git.

1 call to drush_git_deploy_download()
drush_git_deploy_post_pm_enable in ./git_deploy.drush.inc
Implements drush_MODULE_post_COMMAND().

File

./git_deploy.drush.inc, line 35
Drush integration for the git_deploy module.

Code

function drush_git_deploy_download() {
  $args = func_get_args();
  if (isset($args[0])) {
    $path = $args[0];
  }
  else {
    if (module_exists('libraries')) {
      $path = libraries_get_path('glip');
    }
    else {
      $path = variable_get('git_deploy_glip_path', 'sites/all/libraries/glip');
    }
  }
  if (is_dir($path)) {
    drush_log('glip already present. No download required.', 'ok');
  }
  elseif (drush_shell_cd_and_exec(dirname($path), 'git clone https://github.com/halstead/glip.git && cd glip && git checkout 1.1')) {
    variable_set('git_deploy_glip_path', $path);
    drush_log(dt('glip has been cloned via Git to @path.', array(
      '@path' => $path,
    )), 'success');
  }
  else {
    drush_log(dt('Drush was unable to clone glip to @path.', array(
      '@path' => $path,
    )), 'error');
  }
}