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 <learmont@NocturnalAviation.com>
Co-authored-by: Ali Karbassi <ali@karbassi.com>
This commit is contained in:
Tim
2021-08-03 16:11:27 -07:00
committed by GitHub
parent 7501d37b45
commit eb7feaefb5

View File

@@ -414,12 +414,12 @@ test_done () {
mkdir -p "$test_results_dir" mkdir -p "$test_results_dir"
test_results_path="$test_results_dir/${0%.sh}-$$" test_results_path="$test_results_dir/${0%.sh}-$$"
echo "total $test_count" >> $test_results_path echo "total $test_count" >> "$test_results_path"
echo "success $test_success" >> $test_results_path echo "success $test_success" >> "$test_results_path"
echo "fixed $test_fixed" >> $test_results_path echo "fixed $test_fixed" >> "$test_results_path"
echo "broken $test_broken" >> $test_results_path echo "broken $test_broken" >> "$test_results_path"
echo "failed $test_failure" >> $test_results_path echo "failed $test_failure" >> "$test_results_path"
echo "" >> $test_results_path echo "" >> "$test_results_path"
if test "$test_fixed" != 0 if test "$test_fixed" != 0
then then
@@ -476,7 +476,7 @@ test_init_todo () {
mkdir -p "$root" mkdir -p "$root"
cd "$root" || error "Cannot setup todo dir in $root" cd "$root" || error "Cannot setup todo dir in $root"
# Initialize the configuration file. Carefully quoted. # 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 # Install latest todo.sh
mkdir bin mkdir bin