X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/076400ad719d7ba8ed7ff1b27577e330848c7325..414a3ee427b617a3749724fef7dea496780edf4e:/.zsh/zshrc/90_cleanfiles diff --git a/.zsh/zshrc/90_cleanfiles b/.zsh/zshrc/90_cleanfiles index 75a5a49..b4bd2c2 100644 --- a/.zsh/zshrc/90_cleanfiles +++ b/.zsh/zshrc/90_cleanfiles @@ -5,45 +5,43 @@ # 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 +# Source repository: git://git.madduck.net/etc/zsh.git # typeset -la rmfiles -_OLDPWD="$PWD" -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+=core -rmfiles+=nohup.out +rmfiles+=~/plugin131.trace +rmfiles+=~/minicom.log +rmfiles+=~/.cshrc +rmfiles+=~/java.log.*(N) +rmfiles+=~/unison.log +rmfiles+=~/.bzr.log +rmfiles+=~/.fonts.cache-1 +rmfiles+=~/.gksu.lock +rmfiles+=~/.*.sw[mnop](N) +rmfiles+=~/.viminfo +rmfiles+=~/.bash_history +rmfiles+=~/core +rmfiles+=~/nohup.out +rmfiles+=~/typescript +rmfiles+=~/jpilot.log +rmfiles+=~/srtp.log +rmfiles+=~/hs_err_pid[0-9]*.log typeset -la _rmfiles -for f in ${~rmfiles[@]}; do +for f in ${~rmfiles}; do [[ -f $f ]] || continue _rmfiles+="$f" done -unset rmfiles -if [[ -n $_rmfiles ]]; then +if (( $#_rmfiles )); then + _rmfiles=(${_rmfiles#$HOME/}) info "Removing files: ${_rmfiles[@]}..." rm -f ${_rmfiles[@]} fi unset _rmfiles -cd $_OLDPWD -unset _OLDPWD - # vim:ft=zsh