Improve alias usage
This commit is contained in:
parent
d4b8cc50b3
commit
ed699e596a
19
dot_zshrc
19
dot_zshrc
@ -31,22 +31,41 @@ function ls {
|
|||||||
|
|
||||||
# Dotfiles management
|
# Dotfiles management
|
||||||
function .add {
|
function .add {
|
||||||
|
if [[ -z $1 || -z $2 ]]; then
|
||||||
|
echo "Usage: .add <file> <message>"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
chezmoi add $1
|
chezmoi add $1
|
||||||
|
chezmoi git status
|
||||||
chezmoi git diff
|
chezmoi git diff
|
||||||
if $(read -q "?Commit changes? [y/N]"); then
|
if $(read -q "?Commit changes? [y/N]"); then
|
||||||
chezmoi git commit -- -am $2
|
chezmoi git commit -- -am $2
|
||||||
|
if $(read -q "?Push changes? [y/N]"); then
|
||||||
|
chezmoi git push
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
function .re-add {
|
function .re-add {
|
||||||
|
if [[ -z $1 ]]; then
|
||||||
|
echo "Usage: .re-add <message>"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
chezmoi re-add
|
chezmoi re-add
|
||||||
|
chezmoi git status
|
||||||
chezmoi git diff
|
chezmoi git diff
|
||||||
if $(read -q "?Commit changes? [y/N]"); then
|
if $(read -q "?Commit changes? [y/N]"); then
|
||||||
chezmoi git commit -- -am $1
|
chezmoi git commit -- -am $1
|
||||||
|
if $(read -q "?Push changes? [y/N]"); then
|
||||||
|
chezmoi git push
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
alias .push="chezmoi git push"
|
alias .push="chezmoi git push"
|
||||||
alias .pull="chezmoi git pull"
|
alias .pull="chezmoi git pull"
|
||||||
alias .status="chezmoi git status"
|
alias .status="chezmoi git status"
|
||||||
|
alias .diff="chezmoi git diff"
|
||||||
alias .update="chezmoi update"
|
alias .update="chezmoi update"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user