diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-02-25 01:07:38 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2010-02-25 01:07:38 +0100 |
commit | f97a3188b5b42ebc6c71fdcdf6ee761acb686551 (patch) | |
tree | 70cd2ffdb263e48c99934403039611e4cccefb19 /.zsh | |
parent | 7f5628ea608d49c68a89752a637154df966450e0 (diff) | |
download | dotfiles-f97a3188b5b42ebc6c71fdcdf6ee761acb686551.tar.gz dotfiles-f97a3188b5b42ebc6c71fdcdf6ee761acb686551.tar.bz2 dotfiles-f97a3188b5b42ebc6c71fdcdf6ee761acb686551.zip |
Small config commit function
Diffstat (limited to '')
-rw-r--r-- | .zsh/zshfunctions | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index b9c074e..add0202 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -32,6 +32,41 @@ open_ebuild () fi } +# Commit a new config change +cci () +{ + local message files + local tok=__cci__ + + if [[ $# == 0 ]]; then + echo "No message given. Aborting." + return 1 + fi + + message=$1 + shift + files=$@ + + pushd -q ~ + + cstg diff $files + echo -n "Is this ok? [y/n] " + + if ! read -q; then + echo + echo "I would have done the wrong thing ... aborting!" + return 2 + fi + + echo + cstg new $tok -m "$message" + cstg refresh $files + cstg commit $tok + config push + cstg push -a + echo "Done" +} + if [[ $UID == 0 ]]; then # unpack a package |