summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.zsh/zshfunctions26
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