Skip to content

Commit d4e1f1a

Browse files
authored
Fix cleanup script not to remove extracted/bundles directories (element-hq#8764)
1 parent c727e77 commit d4e1f1a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎scripts/cleanup.sh‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ live=`dirname $(readlink -f "$HOME/live")`
99
# currently live bundle (just the name of the bundle)
1010
live_bundle=`grep 'script src="bundles' live/index.html | sed -e 's#.*bundles/##' -e 's#/.*##'`
1111

12-
# clean up 'extracted': find things which are older than 7 days, exclude the current live one, and remove
13-
find $HOME/extracted -maxdepth 1 -type d -ctime +7 \! -path "$live" -exec rm -r {} \;
12+
# clean up 'extracted': find things which are older than 7 days, exclude the
13+
# current live one, and remove
14+
find $HOME/extracted -mindepth 1 -maxdepth 1 -type d -ctime +7 \
15+
\! -path "$live" -exec rm -r {} \;
1416

1517
# clean up 'bundles': ditto
16-
find $HOME/bundles -maxdepth 1 -type d -ctime +7 \! -name "$live_bundle" -exec rm -r {} \;
18+
find $HOME/bundles -mindepth 1 -maxdepth 1 -type d -ctime +7 \
19+
\! -name "$live_bundle" -exec rm -r {} \;

0 commit comments

Comments
 (0)