[Tests] fix cleanup in nvm_supports_xz unit test
parent
31457fec3f
commit
32d184099c
|
@ -1,13 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
OLDPATH=$PATH
|
||||
TEST_PATH=../../xz-test
|
||||
|
||||
mkdir $TEST_PATH
|
||||
cleanup() {
|
||||
rm -rf $TEST_PATH/{xz,which,awk,rm,command}
|
||||
export PATH=$OLDPATH
|
||||
}
|
||||
die () { echo $@ ; cleanup ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
OLDPATH=$PATH
|
||||
|
||||
mkdir -p $TEST_PATH
|
||||
touch ../../xz-test/xz
|
||||
chmod +x ../../xz-test/xz
|
||||
|
||||
|
@ -33,4 +39,4 @@ rm $TEST_PATH/xz
|
|||
$(nvm_supports_xz "v2.3.2") && \
|
||||
die "expected 'nvm_supports_xz v2.3.2' with a missing xz binary to exit with 1"
|
||||
|
||||
export PATH=$OLDPATH
|
||||
cleanup
|
||||
|
|
Loading…
Reference in New Issue