From 22e217f40653e0367ee4762af4b6d0d63d7d060e Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Tue, 20 Aug 2019 21:01:24 -0400 Subject: [PATCH] fish: add ds-patch script --- fish/ds-patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 fish/ds-patch diff --git a/fish/ds-patch b/fish/ds-patch new file mode 100644 index 0000000..084bc11 --- /dev/null +++ b/fish/ds-patch @@ -0,0 +1,14 @@ +#!/usr/bin/env fish + +function ds-patch -d 'Patches a Nintendo DS game' -a zip xp + set out (basename "$zip" .zip).nds + set tmp (mktemp -d) + + unzip "$zip" -d "$tmp" + xdelta3 -d -s "$tmp/"*.nds "$xp" "$tmp/patched.nds" + ndstrim "$tmp/patched.nds" "$out" + + rm -rf "$tmp" +end + +## EOF