diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-02-14 18:36:09 -0500 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-02-14 18:36:09 -0500 |
commit | 6ccd55729e5de45524337084b03eb5a89b9f3ac1 (patch) | |
tree | f6251d12905c2f7007415540173864c5a886b193 /patches/eowyn.sh | |
parent | 95c8ea3cb3bde9427e2364e450a6cf443cdaba5e (diff) | |
download | ziglings-6ccd55729e5de45524337084b03eb5a89b9f3ac1.tar.gz ziglings-6ccd55729e5de45524337084b03eb5a89b9f3ac1.tar.bz2 ziglings-6ccd55729e5de45524337084b03eb5a89b9f3ac1.tar.xz ziglings-6ccd55729e5de45524337084b03eb5a89b9f3ac1.zip |
Added testing ability
For the full details, see patches/README.md :-)
Diffstat (limited to 'patches/eowyn.sh')
-rwxr-xr-x | patches/eowyn.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/eowyn.sh b/patches/eowyn.sh new file mode 100755 index 0000000..53b87d2 --- /dev/null +++ b/patches/eowyn.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# "I will be a shieldmaiden no longer, +# nor vie with the great Riders, nor +# take joy only in the songs of slaying. +# I will be a healer, and love all things +# that grow and are not barren." +# Éowyn, The Return of the King +# +# +# This script shall heal the little broken programs +# using the patches in this directory and convey them +# to convalesce in the healed directory. +# + +# We run from the patches dir. Go there now if not already. +cd $(dirname $(which $0)) +pwd # Show it upon the screen so all shall be made apparent. + +# Create healed/ directory here if it doesn't already exist. +mkdir -p healed + +# Cycle through all the little broken Zig applications. +for broken in ../exercises/*.zig +do + # Remove the dir and extension, rendering the True Name. + true_name=$(basename $broken .zig) + + if [[ -f $true_name.patch ]] + 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=healed/$true_name.zig $broken $true_name.patch + else + echo Cannot heal $true_name. Making empty patch. + echo > $true_name.patch + fi +done + +# Return to the home of our ancestors. +cd .. + +# Test the healed exercises. May the compiler have mercy upon us. +zig build -Dhealed |