Skip to content

Commit f7d748d

Browse files
iHiDclaude
authored andcommitted
Keep main's unquoted lines in the run scripts
Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 15265f2 commit f7d748d

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎bin/run-with-mix.sh‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020

2121
# Save pwd
2222
base_dir=$(pwd)
23-
solution_dir=$(realpath "$2")
24-
output_dir=$(realpath "$3")
23+
solution_dir=$(realpath $2)
24+
output_dir=$(realpath $3)
2525

2626
# Copy solution to /tmp
2727
tmp_sol=$(mktemp -d /tmp/solution_XXXXXXXXXX)
28-
cp -r "${solution_dir}"/* "${tmp_sol}"
29-
solution_dir="${tmp_sol}"
28+
cp -r ${solution_dir}/* ${tmp_sol}
29+
solution_dir=${tmp_sol}
3030

3131
printf "transforming %q\n" "${solution_dir}/mix.exs"
3232
./bin/exercism_test_helper --transform-mix "${solution_dir}/mix.exs:${solution_dir}/mix.exs"
3333

3434
# Find the exercise test files
35-
find "${solution_dir}/test" -type f -name '*.exs' | while read -r file; do
35+
find "${solution_dir}/test" -type f -name '*.exs' | while read file; do
3636
# Skip the test_helper
3737
if [[ $(basename "$file") == 'test_helper.exs' ]]; then
3838
continue
@@ -46,15 +46,15 @@ find "${solution_dir}/test" -type f -name '*.exs' | while read -r file; do
4646
done
4747

4848
# Change directory to the solution folder
49-
cd "${solution_dir}"
49+
cd $solution_dir
5050

5151
# Compile solution
5252
compile_step=$(MIX_ENV=test mix compile 2>&1)
5353

5454
# On compilation error, create results.json with compile error, halt script with error
5555
if [ $? -ne 0 ]; then
5656
jo version=3 status=error message="${compile_step}" tests="[]" > "${output_dir}/results.json"
57-
printf "Compilation contained error, see %s/results.json\n" "${output_dir}"
57+
printf "Compilation contained error, see ${output_dir}/results.json\n"
5858
exit 0
5959
fi
6060

@@ -63,16 +63,16 @@ export JSON_PRINT_FILE=1
6363
export JSON_REPORT_DIR="${solution_dir}"
6464

6565
elixir \
66-
-pa "${base_dir}/exercism_test_helper/_build/test/lib/exercism_test_helper/ebin" \
67-
-pa "${base_dir}/exercism_test_helper/_build/test/lib/jason/ebin" \
66+
-pa ${base_dir}/exercism_test_helper/_build/test/lib/exercism_test_helper/ebin \
67+
-pa ${base_dir}/exercism_test_helper/_build/test/lib/jason/ebin \
6868
-S mix test \
6969
--seed 0 \
7070
--no-deps-check \
7171
--exclude slow \
7272
--formatter JSONFormatter \
7373
> "${solution_dir}/output" 2> "${solution_dir}/error_log"
7474

75-
cd "${base_dir}"
75+
cd $base_dir
7676

7777
# Convert the output log to json
7878
./bin/exercism_test_helper --log-to-json "${solution_dir}/output:${solution_dir}/output.json"
@@ -81,6 +81,6 @@ cd "${base_dir}"
8181
./bin/exercism_test_helper --combine "${solution_dir}/results.json:${solution_dir}/metadata.json:${solution_dir}/output.json"
8282

8383
# Copy result to output directory if required
84-
if [[ "${solution_dir}" != "${output_dir}" ]]; then
84+
if [[ $solution_dir != $output_dir ]]; then
8585
cp "${solution_dir}/results.json" "${output_dir}/results.json"
8686
fi

‎bin/run.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22

33
# Synopsis:
44
# Automatically tests exercism's Elixir track solutions against corresponding test files.
@@ -23,12 +23,12 @@
2323
# (bin/run-with-mix.sh). "Falling back to Mix" in how-this-works.md lists every case.
2424

2525
base_dir=$(pwd)
26-
solution_dir=$(realpath "$2")
27-
output_dir=$(realpath "$3")
26+
solution_dir=$(realpath $2)
27+
output_dir=$(realpath $3)
2828

2929
# Copy solution to /tmp
3030
tmp_sol=$(mktemp -d /tmp/solution_XXXXXXXXXX)
31-
cp -r "${solution_dir}"/* "${tmp_sol}"
31+
cp -r ${solution_dir}/* ${tmp_sol}
3232
cd "${tmp_sol}"
3333

3434
# The hexpm Docker images install Elixir here.

0 commit comments

Comments
 (0)