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