Created
July 13, 2016 18:18
-
-
Save johntran/f886bdf280e74dc7b27120ed3eaff958 to your computer and use it in GitHub Desktop.
ONEHOPE.bash_profile - works for iTerm2
This file contains hidden or 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 bashdir='cd ~' | |
alias atom='open -a "Atom"' | |
alias prof='atom ~/.bash_profile' | |
alias cassandra='cd ~/Documents/Cassandra/datastax-ddc-3.4.0/bin && ./cassandra' | |
alias ms='cd ~/Documents/ONEHOPE/microservice' | |
alias hc='cd ~/hopecommerce-proto' | |
alias devApp='cd ~/hopecommerce-proto && npm run dev-a' | |
alias devGQL='cd ~/hopecommerce-proto && npm run dev-g' | |
alias rDev='cd ~/Documents/ONEHOPE/microservice && npm run dev' | |
function tab () { | |
local cmd="" | |
local cdto="$PWD" | |
local args="$@" | |
if [ -d "$1" ]; then | |
cdto=`cd "$1"; pwd` | |
args="${@:2}" | |
fi | |
if [ -n "$args" ]; then | |
cmd="; $args" | |
fi | |
osascript &>/dev/null <<EOF | |
tell application "iTerm" | |
tell current window | |
set newTab to (create tab with default profile) | |
tell newTab | |
tell current session | |
write text "cd \"$cdto\"$cmd" | |
end tell | |
end tell | |
end tell | |
end tell | |
EOF | |
} | |
function fresh () { | |
tab cassandra | |
tab devApp | |
tab devGQL | |
tab rDev | |
} | |
function reboot () { | |
tab devApp | |
tab devGQL | |
tab rDev | |
} | |
export NVM_DIR="/Users/johntran/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment