04.install_bash_git_prompt.sh 630 B

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