From e278c5dfcd61e9f7f8a39e817c3e2b8005921151 Mon Sep 17 00:00:00 2001 From: Danielle Date: Wed, 9 Nov 2022 05:42:09 -0800 Subject: [PATCH] Add *nix pack mode switcher (#128) * Add *nix pack mode switcher * Actually implement mode switching properly * Add instructions for *nix pack mode switcher * Add flag-based operation * Quote mode in case --- README.md | 1 + pack-mode-switcher.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 pack-mode-switcher.sh diff --git a/README.md b/README.md index 45e7cf2..06e2524 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ If you want a harder, or perhaps a more "true" GregTech experience, check out th Installation instructions: - Install the hardmode config files from [here](https://github.com/tracer4b/nomi-ceu/tree/main/overrides). Restart the pack for this to take effect. - Windows users may grab the utility [here](https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.bat)(right click - save as), save it to the root directory of the pack (the same level as `\config`). + - MacOS and GNU/Linux users can run `curl -s https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.sh | sh` in the pack root directory (the one containing `/config`). - If you are on an existing world, run `/bq_admin default load` to load the hard mode questbook. ## Credits diff --git a/pack-mode-switcher.sh b/pack-mode-switcher.sh new file mode 100755 index 0000000..b1a6e32 --- /dev/null +++ b/pack-mode-switcher.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh +set -e +echo -e "Nomifactory GTCEu Port / Pack mode switcher" + +NORMAL_CFG=./config-overrides/normal +EXPERT_CFG=./config-overrides/expert +TARGET=./config + +if [ -z "$1" ]; then + echo -en "Set pack mode (Normal / Expert): " + read MODE +else + MODE="$1" +fi + +case "$MODE" in + N|n|normal) + cp -rf "$NORMAL_CFG"/* "$TARGET" + rm -f "$TARGET/globalgamerules.cfg" + ;; + + E|e|expert) + cp -rf "$EXPERT_CFG"/* "$TARGET" + ;; + + *) + echo -e "Error: Invalid mode $MODE" + exit 1 + ;; +esac + +echo "Done!"