X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/c6d82b0fcee7968c34407fbc9d8b733142b79fdf..fb8769fc4556cf2fdef03bbcacd913c77a7dcb6a:/.zsh/zshrc/90_cleanfiles?ds=sidebyside diff --git a/.zsh/zshrc/90_cleanfiles b/.zsh/zshrc/90_cleanfiles index b558145..513c01b 100644 --- a/.zsh/zshrc/90_cleanfiles +++ b/.zsh/zshrc/90_cleanfiles @@ -10,41 +10,37 @@ typeset -la rmfiles -_OLDPWD="$PWD" -builtin cd ~ - -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+=~/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 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 -builtin cd $_OLDPWD -unset _OLDPWD - # vim:ft=zsh