diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2023-04-07 16:22:52 +0200 |
---|---|---|
committer | Manlio Perillo <manlio.perillo@gmail.com> | 2023-04-25 12:58:46 +0200 |
commit | 4b58de26d3196a9c344afb9bfea0a50afaf248f5 (patch) | |
tree | 480ba15fde10740f1852267c9b6b4cb929467283 /patches/eowyn.sh | |
parent | 752efd891da5d640b345849471357ba176fe4d1b (diff) |
eowyn: always quote variables
Quote all the variables, even though we know that it is safe.
Fix coding style.
Diffstat (limited to 'patches/eowyn.sh')
-rwxr-xr-x | patches/eowyn.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/patches/eowyn.sh b/patches/eowyn.sh index a036acf..bc57249 100755 --- a/patches/eowyn.sh +++ b/patches/eowyn.sh @@ -14,7 +14,7 @@ # # We check ourselves before we wreck ourselves. -if [ ! -f 'patches/eowyn.sh' ] +if [ ! -f patches/eowyn.sh ] then echo "But I must be run from the project root directory." exit 1 @@ -27,18 +27,17 @@ mkdir -p patches/healed for broken in exercises/*.zig do # Remove the dir and extension, rendering the True Name. - true_name=$(basename $broken .zig) + true_name=$(basename "$broken" .zig) patch_name="patches/patches/$true_name.patch" - - if [ -f $patch_name ] + if [ -f "$patch_name" ] then # Apply the bandages to the wounds, grow new limbs, let # new life spring into the broken bodies of the fallen. - echo Healing $true_name... - patch --output=patches/healed/$true_name.zig $broken $patch_name + echo Healing "$true_name"... + patch --output="patches/healed/$true_name.zig" "$broken" "$patch_name" else - echo Cannot heal $true_name. No patch found. + echo Cannot heal "$true_name". No patch found. fi done |