fork download
  1. export BASH_SILENCE_DEPRECATION_WARNING=1
  2. # added by Anaconda3 2018.12 installer
  3. # >>> conda init >>>
  4. # !! Contents within this block are managed by 'conda init' !!
  5. __conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/aniketiq/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
  6. if [ $? -eq 0 ]; then
  7. \eval "$__conda_setup"
  8. else
  9. if [ -f "/Users/aniketiq/anaconda3/etc/profile.d/conda.sh" ]; then
  10. . "/Users/aniketiq/anaconda3/etc/profile.d/conda.sh"
  11. CONDA_CHANGEPS1=false conda activate base
  12. else
  13. \export PATH="/Users/aniketiq/anaconda3/bin:$PATH"
  14. fi
  15. fi
  16. unset __conda_setup
  17. # <<< conda init <<<
  18. COLOR_RED="\033[0;31m"
  19. COLOR_YELLOW="\033[0;33m"
  20. COLOR_GREEN="\033[0;32m"
  21. COLOR_OCHRE="\033[38;5;95m"
  22. COLOR_BLUE="\033[0;34m"
  23. COLOR_WHITE="\033[0;37m"
  24. COLOR_RESET="\033[0m"
  25.  
  26. #git_color
  27. function git_color {
  28. local git_status="$(git status 2> /dev/null)"
  29.  
  30. if [[ ! $git_status =~ "working directory clean" ]]; then
  31. echo -e $COLOR_RED
  32. elif [[ $git_status =~ "Your branch is ahead of" ]]; then
  33. echo -e $COLOR_YELLOW
  34. elif [[ $git_status =~ "nothing to commit" ]]; then
  35. echo -e $COLOR_GREEN
  36. else
  37. echo -e $COLOR_OCHRE
  38. fi
  39. }
  40.  
  41. #git_branch
  42. function git_branch {
  43. local git_status="$(git status 2> /dev/null)"
  44. local on_branch="On branch ([^${IFS}]*)"
  45. local on_commit="HEAD detached at ([^${IFS}]*)"
  46.  
  47. if [[ $git_status =~ $on_branch ]]; then
  48. local branch=${BASH_REMATCH[1]}
  49. echo "($branch)"
  50. elif [[ $git_status =~ $on_commit ]]; then
  51. local commit=${BASH_REMATCH[1]}
  52. echo "($commit)"
  53. fi
  54. }
  55.  
  56. PS1='\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]'
  57. PS1+="\[\$(git_color)\]" # colors git status
  58. PS1+="\$(git_branch)" # prints current branch
  59. PS1+="\[$COLOR_BLUE\]\[$COLOR_RESET\]\n\[\e[33m\]\$\[\e[0m\] "
  60. export PS1
  61.  
  62. export LC_ALL=en_US.UTF-8
  63. export CLICOLOR=1
  64. export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
  65. alias ls="ls -G"
  66.  
  67. export PATH="$HOME/.cargo/bin:$PATH"
  68.  
  69.  
  70. #Java_HOME
  71.  
  72. export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
  73.  
  74. #Maven
  75.  
  76. export M2_HOME=/Applications/apache-maven-3.6.3
  77. export PATH=$PATH:$M2_HOME/bin
Success #stdin #stdout #stderr 0s 4424KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog.sh: line 72: /usr/libexec/java_home: No such file or directory