mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-08 11:20:46 -05:00
Patches to patches to clean up patches
This commit is contained in:
parent
6ab9b17eb8
commit
ca330b00bc
49 changed files with 8 additions and 9 deletions
|
@ -1,4 +0,0 @@
|
|||
32c32
|
||||
< var answer: u8 = result;
|
||||
---
|
||||
> var answer: u8 = result orelse 42;
|
|
@ -8,7 +8,7 @@ answers are here, so no peeking!
|
|||
## Éowyn
|
||||
|
||||
A Bash shell script named `eowyn.sh` dwells here. She heals the little broken
|
||||
programs and places them in a `healed` directory, which is not committed to the
|
||||
programs and places them in a `healed` directory, which is NOT committed to the
|
||||
repo.
|
||||
|
||||
```bash
|
||||
|
|
|
@ -25,16 +25,18 @@ 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"
|
||||
|
||||
if [[ -f $true_name.patch ]]
|
||||
|
||||
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=healed/$true_name.zig $broken $true_name.patch
|
||||
patch --output=healed/$true_name.zig $broken $patch_name
|
||||
else
|
||||
echo Cannot heal $true_name. Making empty patch.
|
||||
echo > $true_name.patch
|
||||
echo > $patch_name
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ cd $(dirname $(which $0))
|
|||
f=$(basename ../exercises/$1*.zig .zig 2> /dev/null)
|
||||
b=../exercises/$f.zig
|
||||
a=../answers/$f.zig
|
||||
p=$f.patch
|
||||
p=patches/$f.patch
|
||||
|
||||
printf "\tf: '$f'\n\tb: '$b'\n\ta: '$a'\n"
|
||||
|
||||
|
|
1
patches/patches/45_optionals.patch
Normal file
1
patches/patches/45_optionals.patch
Normal file
|
@ -0,0 +1 @@
|
|||
|
Loading…
Reference in a new issue