UnleashedRecomp/tools/apply_ios_submodule_patches.sh
2026-05-18 18:02:53 -05:00

23 lines
802 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PLUME_DIR="$ROOT/thirdparty/plume"
PATCH_FILE="$ROOT/tools/patches/plume-ios-sdl-vulkan.patch"
if [[ ! -d "$PLUME_DIR/.git" && ! -f "$PLUME_DIR/.git" ]]; then
printf 'Missing Plume submodule. Run: git submodule update --init --recursive\n' >&2
exit 1
fi
if git -C "$PLUME_DIR" apply --check "$PATCH_FILE" >/dev/null 2>&1; then
git -C "$PLUME_DIR" apply "$PATCH_FILE"
printf 'Applied Plume iOS patch.\n'
else
if git -C "$PLUME_DIR" apply --reverse --check "$PATCH_FILE" >/dev/null 2>&1; then
printf 'Plume iOS patch already applied.\n'
else
printf 'Plume iOS patch cannot be applied cleanly. Check thirdparty/plume for local changes.\n' >&2
exit 1
fi
fi