Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias be="bundle exec"
- alias ber="bundle exec rspec spec --color"
- alias bec="bundle exec cucumber --color"
- export CLI_COLOR=
- function default_prompt {
- echo "$"
- }
- function red_git_prompt {
- echo -e '\033[0;31m±\033[m'
- }
- function green_git_prompt {
- echo -e '\033[0;32m±\033[m'
- }
- function blue_git_prompt {
- echo -e '\033[0;34m±\033[m'
- }
- function git_prompt {
- local STATUS=`git status 2>&1`
- if [[ "$STATUS" == *'Not a git repository'* ]]; then
- default_prompt
- else
- if [[ "$STATUS" == *'working directory clean'* ]]; then
- green_git_prompt
- else
- if [[ "$STATUS" == *"Changes not staged for commit:"* ]]; then
- red_git_prompt
- elif [[ "$STATUS" == *"Untracked files:"* ]]; then
- red_git_prompt
- else
- blue_git_prompt
- fi
- fi
- fi
- }
- function process_list {
- local PROCESSES=`jobs -p | xargs -I {} ps {} -o "comm= pid=" | xargs -I {} echo -n "({})"`
- if [[ "$PROCESSES" != "" ]]
- then
- echo $PROCESSES
- echo "\n"
- fi
- }
- export PS1='$(process_list)\w $(git_prompt) '
Add Comment
Please, Sign In to add comment