This repository has been archived by the owner on Oct 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from palantirnet/drush-alias
Alias drush
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
- { role: common } | ||
- { role: php } | ||
- { role: drupal } | ||
- { role: drush } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# | ||
# This script wraps drush. It allows you to transparently use a project-local | ||
# drush and drushrc.php, if they are available, but falls back to the system | ||
# drush. | ||
# | ||
# To use it, add a line like this to your ~/.profile: | ||
# alias drush=/var/www/PROJECT_NAME.local/bin/drush | ||
# | ||
# Then, try `drush status` from your home directory, and again from the project | ||
# root. | ||
|
||
THE_DRUSH="/usr/bin/drush" | ||
DRUSH_FLAGS="" | ||
|
||
REPO=$(git rev-parse --show-toplevel 2> /dev/null) | ||
|
||
if [ $REPO ] && [ -e $REPO/vendor/bin/drush ]; then | ||
THE_DRUSH="$REPO/vendor/bin/drush" | ||
fi | ||
|
||
if [ $REPO ] && [ -e $REPO/conf/drushrc.php ]; then | ||
DRUSH_FLAGS="-c $REPO/conf/drushrc.php" | ||
fi | ||
|
||
$THE_DRUSH $DRUSH_FLAGS $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Drush wrapper | Copy drush wrapper | ||
copy: src=../bin dest=/home/vagrant mode=u+rwx | ||
tags: drush | ||
|
||
- name: Drush wrapper | Configure drush wrapper | ||
lineinfile: dest=/home/vagrant/.profile state=present line='export PATH="$PATH:$HOME/bin"' | ||
tags: drush |