Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web/drush.wrapper scaffold file for restricting commands/aliases/config to local repo. #98

Closed
wants to merge 2 commits into from

Conversation

weitzman
Copy link
Contributor

@weitzman weitzman commented Jan 9, 2016

Drush has support for a drush.wrapper in Drupal root which customizes how Drush gets called. The wrapper I propose here adds --local to all Drush requests. This tells Drush not to scan for config, site aliases, and commandfiles in global locations (e.g. ~/.drush, /etc/drush, ...). This environment isolation is very helpful - all Drush requests run the same no matter who's system you are on. Furthermore, it emphasizes that Drush files go in this repo's /drush dir, not in legacy places like ~/.drush. In the rare cases when globally installed commands are needed and can't be copied to our /drush for some reason, user can add --no-local to her request (or in the extreme permanently remove --local from this file).

In order to test this PR, make sure you have some commandfiles, config, or aliases installed to ~/.drush. Then run a drush sa --root=/path/to/web. Notice how your global commands/aliases/config are no longer in effect with this PR.

@weitzman
Copy link
Contributor Author

weitzman commented Mar 3, 2016

ping @greg-1-anderson for review.

@greg-1-anderson
Copy link
Collaborator

I've started to use this feature, and think it still needs a little smoothing out, per drush-ops/drush#2023. Some easy option to add on the commandline to negate the use of the drush wrapper (opposite effect as --local) would also be good.

That said, there will be a drush.wrapper equivalent to this one in the Pantheon version of this project.

@webflo
Copy link
Member

webflo commented Sep 28, 2016

drush-ops/drush#2023 is still open. I think we should adopt the script without the --local flag. This solves the main use case and we don't have to cd back and forth between project root and web.

@weitzman
Copy link
Contributor Author

I'm fine with committing this without --local. I wrote above about the value of this option. I will say that clients who really want to bring in drush commands/config from outside the project can still use drush's --config and --alias-path.

@weitzman
Copy link
Contributor Author

I removed --local. I think this is ready. webflo proposed something similar in #202 (either script would be fine with me).

@weitzman
Copy link
Contributor Author

Actually, this should go into project root not /web. Lets close this in favor of #202 (or ask people to use drupal-shim project).

@weitzman weitzman closed this Dec 19, 2016
@yched
Copy link

yched commented Dec 19, 2016

@weitzman Just curious : what is the "drupal-shim project" ?

@weitzman
Copy link
Contributor Author

Sorry, I mistyped. Here it is: drush-shim

@yched
Copy link

yched commented Dec 19, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants