diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-02-25 01:17:58 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2010-02-25 01:17:59 +0100 |
commit | 7e45e6a89e02fea6b7e28b075e230407ee1df709 (patch) | |
tree | dc3f397140fc33d094aeb45a171d863075c99ef6 | |
parent | f97a3188b5b42ebc6c71fdcdf6ee761acb686551 (diff) | |
download | dotfiles-7e45e6a89e02fea6b7e28b075e230407ee1df709.tar.gz dotfiles-7e45e6a89e02fea6b7e28b075e230407ee1df709.tar.bz2 dotfiles-7e45e6a89e02fea6b7e28b075e230407ee1df709.zip |
Enhance error-checking for 'cci'
-rw-r--r-- | .zsh/zshfunctions | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index add0202..8e3620a 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -58,13 +58,35 @@ cci () return 2 fi - echo + echo ">> Creating new patch" cstg new $tok -m "$message" + + echo ">> Refreshing" cstg refresh $files + + if [[ -z $(cstg files) ]]; then + echo "Ehm - this patch is empty. Narf. Aborting!" + echo "Deleting useless patch" + cstg del $tok + return 3 + fi + + echo ">> Committing" cstg commit $tok + + if [[ -n $(cstg series --applied) ]]; then + echo "Urgs! Something went wrong. There are still patches applied." + echo "Clean up for yourself. Aborting here!" + return 4 + fi + + echo ">> Pushing to remote" config push + + echo ">> Re-apply patches" cstg push -a - echo "Done" + + echo ">> Done" } if [[ $UID == 0 ]]; then |