diff options
| author | Dave Gauer <[email protected]> | 2021-03-12 19:59:17 -0500 |
|---|---|---|
| committer | Dave Gauer <[email protected]> | 2021-03-12 19:59:17 -0500 |
| commit | d560c41b59e11cb488804cbce7a7c2e0f84f8c87 (patch) | |
| tree | 0a1bab03330bebf474dd082864271a601c9140ab /patches/eowyn.sh | |
| parent | 8b4b8b166f8abfc30a22776ddc2f73c9e8a80932 (diff) | |
| download | ziglings-d560c41b59e11cb488804cbce7a7c2e0f84f8c87.tar.xz ziglings-d560c41b59e11cb488804cbce7a7c2e0f84f8c87.zip | |
Patch/test scripts now run from project root
This simplifies everything and makes everything good.
(Shell scripts need to be as simple as possible for maximum
compatibility.)
Diffstat (limited to 'patches/eowyn.sh')
| -rwxr-xr-x | patches/eowyn.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/patches/eowyn.sh b/patches/eowyn.sh index f450c0e..1ff3f75 100755 --- a/patches/eowyn.sh +++ b/patches/eowyn.sh @@ -13,19 +13,22 @@ # to convalesce in the healed directory. # -# We run from the patches dir. Go there now if not already. -cd $(dirname $(realpath $0)) -pwd # Show it upon the screen so all shall be made apparent. +# We check ourselves before we wreck ourselves. +if [ ! -f 'patches/eowyn.sh' ] +then + echo "But I must be run from the project root directory." + exit 1 +fi -# Create healed/ directory here if it doesn't already exist. -mkdir -p healed +# Create directory of healing if it doesn't already exist. +mkdir -p patches/healed # Cycle through all the little broken Zig applications. -for broken in ../exercises/*.zig +for broken in exercises/*.zig do # Remove the dir and extension, rendering the True Name. true_name=$(basename $broken .zig) - patch_name="patches/$true_name.patch" + patch_name="patches/patches/$true_name.patch" if [ -f $patch_name ] @@ -33,14 +36,11 @@ do # 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=healed/$true_name.zig $broken $patch_name + patch --output=patches/healed/$true_name.zig $broken $patch_name else echo Cannot heal $true_name. No patch found. fi done -# Return to the home of our ancestors. -cd .. - # Test the healed exercises. May the compiler have mercy upon us. zig build -Dhealed |
