diff --git a/drush/Commands/PolicyCommands.php b/drush/Commands/PolicyCommands.php new file mode 100644 index 0000000000..85ee907a85 --- /dev/null +++ b/drush/Commands/PolicyCommands.php @@ -0,0 +1,39 @@ +input()->getArgument('destination') == '@prod') { + throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__])); + } + } + + /** + * Limit rsync operations to production site. + * + * @hook validate core:rsync + * + * @throws \Exception + */ + public function rsyncValidate(CommandData $commandData) { + if (preg_match("/^@prod/", $commandData->input()->getArgument('destination'))) { + throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__])); + } + } +} diff --git a/drush/drush.yml b/drush/drush.yml new file mode 100644 index 0000000000..de78500f05 --- /dev/null +++ b/drush/drush.yml @@ -0,0 +1,6 @@ +# +# A Drush configuration file +# +# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml +# +# Edit or remove this file as needed. \ No newline at end of file diff --git a/drush/policy.drush.inc b/drush/policy.drush.inc deleted file mode 100644 index 64cd62d0f6..0000000000 --- a/drush/policy.drush.inc +++ /dev/null @@ -1,38 +0,0 @@ -