Index: jquery_ui.drush.inc =================================================================== --- jquery_ui.drush.inc (revision 0) +++ jquery_ui.drush.inc (revision 4030) @@ -0,0 +1,45 @@ + 'Download the jQuery UI library.', + 'arguments' => array( + 'path' => dt('Optional. A path to the download folder. If omitted Drush will use the default location (sites/all/libraries/jquery.ui).'), + ), + ); + return $items; +} + +/** + * Checkout jQuery UI 1.6 from SVN. + */ +function drush_jquery_ui_jqueryui_download() { + $args = func_get_args(); + if ($args) { + $path = $args[0]; + } + else { + $path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/jquery.ui'; + } + + if (drush_shell_exec('svn checkout http://jquery-ui.googlecode.com/svn/tags/1.6/ ' . $path)) { + drush_log(dt('jQuery UI has been downloaded to @path.', array('@path' => $path)), 'success'); + } + else { + drush_log(dt('Drush was unable to download the jQuery UI to @path.', array('@path' => $path)), 'error'); + } +} + +/** + * Implements drush_MODULE_post_COMMAND(). + */ +function drush_jquery_ui_post_enable() { + $modules = func_get_args(); + if (in_array('jquery_ui', $modules)) { + jquery_ui_drush_download(); + } +}