added function named 'home' to .zshrc; this is for managing HOME updates
This commit is contained in:
parent
0f8f9efb56
commit
9ee8bcbcb2
1 changed files with 35 additions and 0 deletions
35
.zshrc
35
.zshrc
|
|
@ -83,6 +83,41 @@ then
|
|||
source ~/.zshprivate
|
||||
fi
|
||||
|
||||
function home_help() {
|
||||
echo "available commands:"
|
||||
echo ""
|
||||
echo "help: show this help text"
|
||||
echo "pull: execute git pull in $HOME"
|
||||
echo "sub: update all submodules of $HOME"
|
||||
echo "up: pull and update submodules in $HOME"
|
||||
}
|
||||
|
||||
function home() {
|
||||
case $1 in
|
||||
help)
|
||||
home_help
|
||||
;;
|
||||
pull)
|
||||
cd ~
|
||||
git pull
|
||||
;;
|
||||
sub)
|
||||
cd ~
|
||||
git submodule update --init --recursive
|
||||
;;
|
||||
up)
|
||||
cd ~
|
||||
git pull
|
||||
git submodule update --init --recursive
|
||||
;;
|
||||
*)
|
||||
echo "command not found!"
|
||||
echo ""
|
||||
home_help
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Some aliases
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue