format-readme: pick up latest version
[girocco.git] / toolbox / clear-all-htmlcache.sh
blob0c9ced5f435ae20ecb5fabf7a7e1d6e6a36b0325
1 #!/bin/sh
3 # Remove all files present in the htmlcache subdirectory of each project.
4 # A count of projects that had files to be removed is displayed.
6 set -e
8 . @basedir@/shlib.sh
10 umask 002
12 base="$cfg_reporoot"
13 cut -d : -f 1 < "$cfg_chroot/etc/group" | grep -v ^_repo | \
15 count=0
16 while read proj; do
17 projdir="$base/$proj.git"
18 if cd "$projdir/htmlcache" 2>/dev/null; then
19 if [ "$(echo *)" != '*' ]; then
20 rm -f * 2>/dev/null
21 count=$(( $count + 1 ))
22 if [ $(( $count % 10 )) = 0 ]; then
23 printf '%s ' $count
27 done
28 if [ $(( $count % 10 )) != 0 ]; then
29 printf '%s ' $count
31 printf '%s\n' 'done'