Skip to content

Commit

Permalink
Revert "Update /drush dir for Drush9"
Browse files Browse the repository at this point in the history
This reverts commit 902fa86.
  • Loading branch information
weitzman committed Feb 9, 2018
1 parent 902fa86 commit 527cd79
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 71 deletions.
55 changes: 0 additions & 55 deletions drush/Commands/PolicyCommands.php

This file was deleted.

14 changes: 0 additions & 14 deletions drush/Sites/self.site.yml

This file was deleted.

2 changes: 0 additions & 2 deletions drush/drush.yml

This file was deleted.

38 changes: 38 additions & 0 deletions drush/policy.drush.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

/*
* Customize this file as desired. See https://github.com/drush-ops/drush/blob/8.x/examples/policy.drush.inc for documentation.
*/

/**
* Implements drush_hook_COMMAND_validate().
*
* Encourage folks to use `composer` instead of Drush pm commands
*/
function drush_policy_pm_updatecode_validate() {
return _deny_message();
}

function drush_policy_pm_update_validate() {
return _deny_message();
}

function drush_policy_pm_download_validate() {
return _deny_message();
}

function _deny_message() {
if (!drush_get_option('pm-force')) {
$msg = 'This codebase is assembled with Composer instead of Drush. Use `composer update` and `composer require` instead of `drush pm-updatecode` and `drush pm-download`. You may override this error by using the --pm-force option.';
return drush_set_error('POLICY_PM_DENY', dt($msg));
}
}

/**
* Implements hook_drush_help_alter().
*/
function policy_drush_help_alter(&$command) {
if (in_array($command['command'], array('pm-updatecode', 'pm-update', 'pm-download'))) {
$command['options']['pm-force'] = 'Override site policy and allow Drush codebase management (pm-* commands)';
}
}

0 comments on commit 527cd79

Please sign in to comment.