download_test_vectors.sh: delete tarballs and unpacked data from old versions

This commit is contained in:
Ștefan Talpalaru 2019-10-31 21:28:32 +01:00
parent 0ea5ae67e0
commit e6aeff84be
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 23 additions and 3 deletions

5
.gitignore vendored
View File

@ -1,4 +1,5 @@
nimcache/
build/
tarballs/
tests-*/
/tarballs
/tests-*

View File

@ -2,6 +2,10 @@
set -eu
VERSIONS=(
"v0.8.3"
"v0.9.0"
)
FLAVOURS=(
"general"
"minimal"
@ -64,7 +68,22 @@ unpack_version() {
fi
}
for version in "v0.8.3" "v0.9.0"; do
# download and unpack
for version in "${VERSIONS[@]}"; do
unpack_version "$version"
done
# delete tarballs and unpacked data from old versions
for tpath in tarballs/*; do
tdir="$(basename "$tpath")"
if [[ ! " ${VERSIONS[@]} " =~ " $tdir " ]]; then
rm -rf "$tpath"
fi
done
for tpath in tests-*; do
tver="$(echo "$tpath" | cut -d '-' -f 2)"
if [[ ! " ${VERSIONS[@]} " =~ " $tver " ]]; then
rm -rf "$tpath"
fi
done