]> git.madduck.net Git - etc/zsh.git/blob - .zsh/zshrc/90_cleanfiles

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

handle a little better when GIT_DIR is set
[etc/zsh.git] / .zsh / zshrc / 90_cleanfiles
1 # zlogout/90_cleanfiles
2 #
3 # remove files we never want to keep around
4 #
5 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
7 #
8 # Source repository: http://git.madduck.net/v/etc/zsh.git
9 #
10
11 typeset -la rmfiles
12
13 _OLDPWD="$PWD"
14 cd ~
15
16 rmfiles+=plugin131.trace
17 rmfiles+=minicom.log
18 rmfiles+=.cshrc
19 rmfiles+=java.log.*
20 rmfiles+=unison.log
21 rmfiles+=.bzr.log
22 rmfiles+=.fonts.cache-1
23 rmfiles+=.gksu.lock
24 rmfiles+=.*.sw[mnop]
25 rmfiles+=.viminfo
26 rmfiles+=.bash_history
27 rmfiles+=core
28 rmfiles+=nohup.out
29
30 typeset -la _rmfiles
31
32 for f in ${~rmfiles[@]}; do
33   [[ -f $f ]] || continue
34   _rmfiles+="$f"
35 done
36
37 unset rmfiles
38
39 if [[ -n $_rmfiles ]]; then
40   info "Removing files: ${_rmfiles[@]}..."
41   rm -f ${_rmfiles[@]}
42 fi
43
44 unset _rmfiles
45
46 cd $_OLDPWD
47 unset _OLDPWD
48
49 # vim:ft=zsh