Created
July 1, 2026 02:06
-
-
Save pingbird/fba83597be28b648e44f40fb75cf8788 to your computer and use it in GitHub Desktop.
Inject git-pull-on-launch into Mindustry.app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| MACOS_DIR="/Users/ping/Library/Application Support/Steam/steamapps/common/Mindustry/Mindustry.app/Contents/MacOS" | |
| MODS_DIR="/Users/ping/Library/Application Support/Steam/steamapps/common/Mindustry/saves/mods" | |
| if [ ! -d "$MODS_DIR/.git" ]; then | |
| git clone git@github.com:pingbird/mindustry-mods.git "$MODS_DIR" | |
| fi | |
| if file "$MACOS_DIR/Mindustry" | grep -q "shell script"; then | |
| echo "Already injected." | |
| exit 0 | |
| fi | |
| cp "$MACOS_DIR/Mindustry" "$MACOS_DIR/Mindustry.bin" | |
| cp "$MACOS_DIR/../Resources/Mindustry.json" "$MACOS_DIR/../Resources/Mindustry.bin.json" | |
| cat > "$MACOS_DIR/Mindustry" << 'EOF' | |
| #!/bin/bash | |
| MODS_DIR="/Users/ping/Library/Application Support/Steam/steamapps/common/Mindustry/saves/mods" | |
| if [ -d "$MODS_DIR/.git" ]; then | |
| git -C "$MODS_DIR" pull --ff-only 2>/dev/null | |
| fi | |
| exec "$(dirname "$0")/Mindustry.bin" "$@" | |
| EOF | |
| chmod +x "$MACOS_DIR/Mindustry" | |
| echo "Injected." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment