From e6aeff84bec3003906c8862ccca213d516929025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 31 Oct 2019 21:28:32 +0100 Subject: [PATCH] download_test_vectors.sh: delete tarballs and unpacked data from old versions --- .gitignore | 5 +++-- download_test_vectors.sh | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 819200a..bbcecb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ nimcache/ build/ -tarballs/ -tests-*/ +/tarballs +/tests-* + diff --git a/download_test_vectors.sh b/download_test_vectors.sh index 6b04a41..9f56d06 100755 --- a/download_test_vectors.sh +++ b/download_test_vectors.sh @@ -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 +