From eb7feaefb56a44b9773303188bccce98c2e2d1b4 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 3 Aug 2021 16:11:27 -0700 Subject: [PATCH] Fix problem with spaces in directory path (#276) If the current directory had spaces in the directory path, this script would fail. That has been fixed by appropriate use of quotes. Co-authored-by: Tim Learmont Co-authored-by: Ali Karbassi --- tests/test-lib.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 499f9c7..aef6c96 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -414,12 +414,12 @@ test_done () { mkdir -p "$test_results_dir" test_results_path="$test_results_dir/${0%.sh}-$$" - echo "total $test_count" >> $test_results_path - echo "success $test_success" >> $test_results_path - echo "fixed $test_fixed" >> $test_results_path - echo "broken $test_broken" >> $test_results_path - echo "failed $test_failure" >> $test_results_path - echo "" >> $test_results_path + echo "total $test_count" >> "$test_results_path" + echo "success $test_success" >> "$test_results_path" + echo "fixed $test_fixed" >> "$test_results_path" + echo "broken $test_broken" >> "$test_results_path" + echo "failed $test_failure" >> "$test_results_path" + echo "" >> "$test_results_path" if test "$test_fixed" != 0 then @@ -476,7 +476,7 @@ test_init_todo () { mkdir -p "$root" cd "$root" || error "Cannot setup todo dir in $root" # Initialize the configuration file. Carefully quoted. - sed -e 's|TODO_DIR=.*$|TODO_DIR="'"$TEST_DIRECTORY/$test"'"|' $TEST_DIRECTORY/../todo.cfg > todo.cfg + sed -e 's|TODO_DIR=.*$|TODO_DIR="'"$TEST_DIRECTORY/$test"'"|' "$TEST_DIRECTORY/../todo.cfg" > todo.cfg # Install latest todo.sh mkdir bin