webui: remember last used branch

This commit is contained in:
2013-12-18 20:47:44 +03:00
parent be22036c10
commit 120ed6dabf

15
.rc
View File

@@ -104,7 +104,20 @@ alias sudo='sudo -E '
alias su='su -m'
# work
alias webui='cd $webui'
function webui() {
if [ -n "$1" ]; then
if [ "$1" = "trunk" ]; then
webui="$RAILS/trunk"
else
webui="$RAILS/branches/$1"
fi
echo $webui >~/.webui
else
webui=$(cat ~/.webui 2>/dev/null)
[ $? -eq 0 ] || webui="$RAILS"
fi
cd $webui
}
# useful stuff
[ -z "$VIM_ORIGINAL" ] && VIM_ORIGINAL="$(which vim)"