Change soft-fail to use the config, rather than env
[rbx.git] / tools / rubuildius / bin / cleanup.zsh
blob0e99b141547aa25a47959147a09a9030f11f7def
1 #!/bin/zsh
3 setopt extendedglob
5 cd $1
7 integer ndirs
8 dirs=(*~HEAD(/N))
9 (( ndirs = ${#dirs} ))
11 # if there are more than 20 dirs, delete the last 10 of them.
12 # be sure to never delete HEAD accidently.
13 [[ $ndirs -gt 20 ]] && rm -rf *~HEAD(D/om[-11,-1])
15 exit 0