summaryrefslogtreecommitdiff
path: root/.zsh/functions
diff options
context:
space:
mode:
authorRené Neumann <rene.neumann@in.tum.de>2012-02-23 19:41:59 +0100
committerRené Neumann <rene.neumann@in.tum.de>2012-02-23 19:42:00 +0100
commitc473fc6be242abd7d2fc343edd9c6639dd34a51a (patch)
tree569ebd3528e202df06e21d473e9a2acc0531db9a /.zsh/functions
parent1ec3034f50c4cd9254148ddbdf42114b1cb26f85 (diff)
downloaddotfiles-c473fc6be242abd7d2fc343edd9c6639dd34a51a.tar.gz
dotfiles-c473fc6be242abd7d2fc343edd9c6639dd34a51a.tar.bz2
dotfiles-c473fc6be242abd7d2fc343edd9c6639dd34a51a.zip
Cleanup using TRAPEXIT
Diffstat (limited to '.zsh/functions')
-rw-r--r--.zsh/functions/cci9
1 files changed, 6 insertions, 3 deletions
diff --git a/.zsh/functions/cci b/.zsh/functions/cci
index b03666e..669f08f 100644
--- a/.zsh/functions/cci
+++ b/.zsh/functions/cci
@@ -18,6 +18,12 @@ log ()
echo ${fg_bold[white]}">> $1"${reset_color}
}
+TRAPEXIT ()
+{
+ # cleanup
+ unfunction ask log
+}
+
if [[ $# == 0 ]]; then
echo "No message given. Aborting."
return 1
@@ -90,7 +96,4 @@ log "Done"
popd -q
-# cleanup
-unfunction ask log
-
# vim: ft=zsh