summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadrieril2020-02-23 21:13:30 +0000
committerNadrieril2020-03-05 15:58:54 +0000
commitd0a1416b4f2f8138a0751553aac0f34be82e579a (patch)
tree3d8fdf174bbc2063cb88d203ede9655000025075
parent2fc9a64250ee90dc55ca7dcf456855c9d61ad67f (diff)
Make script more robust to missing folders
-rwxr-xr-xupdate-tests.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/update-tests.sh b/update-tests.sh
index eeb79bd..1bc0a08 100755
--- a/update-tests.sh
+++ b/update-tests.sh
@@ -89,11 +89,14 @@ function generate_output_file() {
if [ "$1" = "missing" ]; then
echo "Generating missing output files..."
for folder in parser binary-decode semantic-hash import type-inference normalization alpha-normalization; do
- fd 'A\.dhallb?$' ./dhall-lang/tests/$folder/success ./dhall/tests/$folder/success \
- | sed 's/A.dhallb\?$//' \
- | while read file; do
- generate_output_file "$folder" "$file"
- done
+ for root in "./dhall-lang/tests" "./dhall/tests"; do
+ # This is not robust to spaces in filenames, but hopefully there should be none
+ fd 'A\.dhallb?$' "$root/$folder/success" \
+ | sed 's/A.dhallb\?$//' \
+ | while read file; do
+ generate_output_file "$folder" "$file"
+ done
+ done
done
elif [ "$1" = "add" ]; then