Last active
July 5, 2018 09:51
-
-
Save thealscott/32e0c050d36c5c65bf75 to your computer and use it in GitHub Desktop.
Bash Profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias sub='open -a "Sublime Text"' | |
alias currentbranch='git rev-parse --abbrev-ref HEAD' | |
alias testnomigrations='forage test --settings=yunojuno.settings.test_settings.skipmigrations --verbosity=2' | |
export NVM_DIR="/Users/alasdairscott/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
# Git/SVN PS1 | |
parse_git_branch () { | |
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then git branch | sed -n '/\* /s///p'; fi | awk '{print " ["$1"]" }' | |
} | |
parse_svn_branch() { | |
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk '{print " ["$1"]" }' | |
} | |
parse_svn_url() { | |
svn info 2>/dev/null | sed -ne 's#^URL: ##p' | |
} | |
parse_svn_repository_root() { | |
svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p' | |
} | |
db_capture () { ~/Documents/website/vagrant/download_pgbackup $1 ~/Documents/website/docker/postgres/$1.bak; } | |
db_restore () { docker-compose exec postgres /data/pg_local_restore yunojuno /data/$1.bak; } | |
BLACK="\[\033[0;38m\]" | |
RED="\[\033[0;31m\]" | |
RED_BOLD="\[\033[01;31m\]" | |
BLUE="\[\033[01;34m\]" | |
GREEN="\[\033[0;32m\]" | |
export PS1="$BLUE\w$RED_BOLD\$(parse_git_branch)\$(parse_svn_branch)$BLACK$ " | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
alias dc="docker-compose" | |
alias dm="docker-machine" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment