- 98 commands across com wheel, item, enemy, ability and blitz groups - shared command table drives wheel dropdowns, keybinds and localization - tools/check_upstream.py validates triggers against the game source dump - weekly GitHub Action opens an issue when triggers change upstream
17 lines
860 B
Bash
Executable File
17 lines
860 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Rename the mod. Usage: tools/rename.sh NewName
|
|
set -euo pipefail
|
|
NEW="${1:?usage: tools/rename.sh NewName}"
|
|
cd "$(dirname "$0")/.."
|
|
OLD=$(ls -d */ | sed 's#/##' | while read d; do [ -f "$d/$d.mod" ] && echo "$d"; done | head -1)
|
|
[ -n "$OLD" ] || { echo "could not find current mod folder"; exit 1; }
|
|
echo "Renaming $OLD -> $NEW"
|
|
git mv "$OLD/scripts/mods/$OLD" "$OLD/scripts/mods/$NEW" 2>/dev/null || mv "$OLD/scripts/mods/$OLD" "$OLD/scripts/mods/$NEW"
|
|
for f in "$OLD/scripts/mods/$NEW/$OLD"*.lua "$OLD/$OLD.mod"; do
|
|
n="${f//$OLD/$NEW}"; n="${n/#$NEW\/scripts/$OLD/scripts}"; n="${n/#$NEW\/$NEW.mod/$OLD/$NEW.mod}"
|
|
git mv "$f" "$n" 2>/dev/null || mv "$f" "$n"
|
|
done
|
|
git mv "$OLD" "$NEW" 2>/dev/null || mv "$OLD" "$NEW"
|
|
grep -rl "$OLD" "$NEW" README.md tools .github | xargs sed -i "s/$OLD/$NEW/g"
|
|
echo "Done. Review with: git status"
|