enable_bash_git_prompt.sh 470 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. {
  7. echo ""
  8. echo "# bash git prompt"
  9. echo "if [ -f ~/src/bash-git-prompt/gitprompt.sh ]; then"
  10. echo " # To only show the git prompt in or under a repository directory"
  11. echo " GIT_PROMPT_ONLY_IN_REPO=1"
  12. echo " # To use upstream's default theme"
  13. echo " GIT_PROMPT_THEME=Default"
  14. echo " source ~/src/bash-git-prompt/gitprompt.sh"
  15. echo "fi"
  16. }>>~/.bashrc
  17. source ~/.bashrc