X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Fexamples%2Fexample.prompt.sh;fp=vendor%2Fdrush%2Fdrush%2Fexamples%2Fexample.prompt.sh;h=adeab93019c183f05653419d5b6c5ff0921e7ecb;hp=fd8fee14dcdc722598b4db5c7d30bdd2e7b42015;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drush/drush/examples/example.prompt.sh b/vendor/drush/drush/examples/example.prompt.sh index fd8fee14d..adeab9301 100644 --- a/vendor/drush/drush/examples/example.prompt.sh +++ b/vendor/drush/drush/examples/example.prompt.sh @@ -2,11 +2,37 @@ # # Example PS1 prompt. # -# Use `drush init` to copy this to ~/.drush/drush.prompt.sh, and source it in ~/.bashrc +# Use `drush init` to copy this to ~/.drush/drush.prompt.sh, and source it in +# ~/.bashrc or ~/.bash_profile. +# +# Note that your Bash session must already have the __git_ps1 function available. +# Typically this is provided by git-prompt.sh, see instructions for downloading +# and including this file here: +# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh # # Features: # # Displays Git repository and Drush alias status in your prompt. + +__drush_ps1() { + f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" + if [ -f $f ] + then + __DRUPAL_SITE=$(cat "$f") + else + __DRUPAL_SITE="$DRUPAL_SITE" + fi + + # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a + # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 + # prompt. See example.prompt.sh for an example implementation. + if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then + __drush_ps1_colorize_alias + fi + + [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" +} + if [ -n "$(type -t __git_ps1)" ] && [ "$(type -t __git_ps1)" = function ] && [ "$(type -t __drush_ps1)" ] && [ "$(type -t __drush_ps1)" = function ]; then # This line enables color hints in your Drush prompt. Modify the below