From d0a1416b4f2f8138a0751553aac0f34be82e579a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 23 Feb 2020 21:13:30 +0000 Subject: Make script more robust to missing folders --- update-tests.sh | 13 ++++++++----- 1 file 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 -- cgit v1.2.3