From: martin f. krafft Date: Thu, 8 May 2008 11:22:15 +0000 (+0100) Subject: more sophisticated cleaning X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/c4435c2102114c87ea2f7c2bc117c7676f66ac0d more sophisticated cleaning --- diff --git a/.zsh/zlogout/90_cleanfiles b/.zsh/zlogout/90_cleanfiles new file mode 100644 index 0000000..3bc5bd8 --- /dev/null +++ b/.zsh/zlogout/90_cleanfiles @@ -0,0 +1,44 @@ +# zlogout/90_cleanfiles +# +# remove files we never want to keep around +# +# Copyright © 1994–2008 martin f. krafft +# Released under the terms of the Artistic Licence 2.0 +# +# Source repository: http://git.madduck.net/v/etc/zsh.git +# + +typeset -la rmfiles + +cd ~ + +rmfiles+=plugin131.trace +rmfiles+=minicom.log +rmfiles+=.cshrc +rmfiles+=java.log.* +rmfiles+=unison.log +rmfiles+=.bzr.log +rmfiles+=.fonts.cache-1 +rmfiles+=.gksu.lock +rmfiles+=.*.sw[mnop] +rmfiles+=.viminfo +rmfiles+=.bash_history +rmfiles+=.xsession-errors + +typeset -la _rmfiles + +for f in ${~rmfiles[@]}; do + [[ -f $f ]] || continue + _rmfiles+="$f" +done + +unset rmfiles + +if [[ -n $_rmfiles ]]; then + info "Removing files: ${_rmfiles[@]}..." + rm -f ${_rmfiles[@]} +fi + +unset _rmfiles + +# vim:ft=zsh