You are here

function drush_rmrnjs_plugin in Responsive Navigation 7

Command to delete the responsive-nav.js plugin. Use drush --verbose for extra log detail.

1 string reference to 'drush_rmrnjs_plugin'
responsive_navigation_drush_command in ./responsive_navigation.drush.inc
Implements hook_drush_command().

File

./responsive_navigation.drush.inc, line 103

Code

function drush_rmrnjs_plugin() {
  $args = func_get_args();
  if (!empty($args[0])) {
    $path = $args[0];
  }
  else {
    $path = 'sites/all/libraries';
  }
  if (!is_dir($path)) {
    drush_log(dt('Directory @path was not found.', array(
      '@path' => $path,
    )), 'error');
  }
  $olddir = getcwd();
  chdir($path);
  if (is_dir('responsive_navigation')) {
    drush_log(dt('The responsive_navigation directory was found at @path. Attempting to delete it.', array(
      '@path' => $path,
    )), 'notice');
    if (drush_delete_dir('responsive_navigation', TRUE)) {
      drush_log(dt('The responsive_navigation directory has been deleted in @path', array(
        '@path' => $path,
      )), 'success');
    }
    else {
      drush_log(dt('Drush was unable to delete the responsive_navigation directory in @path', array(
        '@path' => $path,
      )), 'error');
    }
  }
  else {
    drush_log(dt('Drush was unable to find the responsive_navigation directory in @path', array(
      '@path' => $path,
    )), 'error');
  }
  chdir($olddir);
}