You are here

function drush_mathjax_download in MathJax: LaTeX for Drupal 6

Same name and namespace in other branches
  1. 7 includes/mathjax.drush.inc \drush_mathjax_download()

Downloads MathJax to the libraries directory.

1 call to drush_mathjax_download()
drush_mathjax_post_enable in includes/mathjax.drush.inc
Implements drush_MODULE_post_COMMAND().
1 string reference to 'drush_mathjax_download'
mathjax_drush_command in includes/mathjax.drush.inc
Implements hook_drush_command().

File

includes/mathjax.drush.inc, line 24
MathJax module drush integration.

Code

function drush_mathjax_download() {
  $args = func_get_args();
  if ($args[0]) {
    $path = $args[0];
  }
  else {
    $path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/mathjax';
  }
  if (drush_shell_exec('mkdir ' . $path . '; git clone git://github.com/mathjax/MathJax.git ' . $path)) {
    drush_log(dt('MathJax has been downloaded to @path.', array(
      '@path' => $path,
    )), 'success');
  }
  else {
    drush_log(dt('Drush was unable to download the MathJax to @path.', array(
      '@path' => $path,
    )), 'error');
  }
}