From c4435c2102114c87ea2f7c2bc117c7676f66ac0d Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 8 May 2008 12:22:15 +0100 Subject: [PATCH 1/1] more sophisticated cleaning --- .zsh/zlogout/90_cleanfiles | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .zsh/zlogout/90_cleanfiles 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 -- 2.39.5