Proper garbage collection for ~/.forgebuild/ test

This commit is contained in:
southerntofu 2020-11-28 15:33:55 +01:00
parent 93698d8df4
commit 6c0eb6b104
1 changed files with 4 additions and 2 deletions

View File

@ -51,6 +51,10 @@ function teardown {
function clean {
if [ -d $TMPDIR ]; then rm -rf $TMPDIR; fi
# This is only for the last test (with ~/.forgebuild basedir)
if [ -f $HOME/.forgebuild/TESTtime ]; then rm $HOME/.forgebuild/TESTtime; fi
if [ -f $HOME/.forgebuild/TESTtime.source ]; then rm $HOME/.forgebuild/TESTtime.source; fi
if [ -f $HOME/.forgebuild/.TESTtime ]; then rm -rf $HOME/.forgebuild/.TESTtime; fi
}
# Simple repository
@ -326,6 +330,4 @@ function setup_submodule {
cp $FORGEBUILDDIR/time $HOME/.forgebuild/TESTtime
cp $FORGEBUILDDIR/time.source $HOME/.forgebuild/TESTtime.source
$FORGEBUILD TESTtime
rm $HOME/.forgebuild/TESTtime*
rm -rf $HOME/.forgebuild/.TESTtime
}