From 564a9e262640eafd1c3d51509ec4d3fe828c65f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Sat, 4 Nov 2023 13:16:20 +0100 Subject: [PATCH] add `enable-patch.sh` and `disable-patch.sh` --- scripts/disable-patch.sh | 8 ++++++++ scripts/enable-patch.sh | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 scripts/disable-patch.sh create mode 100755 scripts/enable-patch.sh diff --git a/scripts/disable-patch.sh b/scripts/disable-patch.sh new file mode 100755 index 0000000..48eb463 --- /dev/null +++ b/scripts/disable-patch.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +sed -i "\#${1/./\.}#d" assets/patches.txt diff --git a/scripts/enable-patch.sh b/scripts/enable-patch.sh new file mode 100755 index 0000000..eaf4928 --- /dev/null +++ b/scripts/enable-patch.sh @@ -0,0 +1,14 @@ +#!/usr/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +if grep -q "$1" assets/patches.txt; then + echo "Patch already enabled" + exit 1 +fi + +echo "$1" >>assets/patches.txt +sort assets/patches.txt -o assets/patches.txt