feat: refactor post-install hooks to manifest-driven system

- Replace hardcoded hooks with external scripts in scripts/hooks/
- Add 4 generic hook scripts (copy-standard-lua, copy-aio-lua, mod-ale-patches, black-market-setup)
- Update all 28 module hook definitions in config/modules.json
- Remove legacy hook functions from manage-modules.sh
- Add 26 new Eluna Lua modules to .env.template (disabled by default)
- Add 3 new AIO modules to .env.template (disabled by default)
- Implement proper environment variable interface for hooks
- Add comprehensive documentation and refactoring summary

🤖 Generated with [Claude Code](https://claude.ai/code)
This commit is contained in:
uprightbass360
2025-11-01 18:53:34 -04:00
parent ea39506bcc
commit 64d0478320
9 changed files with 842 additions and 59 deletions

52
scripts/hooks/mod-ale-patches Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# Module-specific hook for mod-ale compatibility patches
set -e
# Hook environment
MODULE_KEY="${MODULE_KEY:-}"
MODULE_DIR="${MODULE_DIR:-}"
MODULE_NAME="${MODULE_NAME:-}"
if [ -z "$MODULE_DIR" ] || [ ! -d "$MODULE_DIR" ]; then
echo "❌ mod-ale-patches: Invalid module directory: $MODULE_DIR"
exit 2
fi
echo "🔧 mod-ale-patches: Applying compatibility fixes to $MODULE_NAME"
# Apply MovePath compatibility patch
apply_movepath_patch() {
local target_file="$MODULE_DIR/src/LuaEngine/methods/CreatureMethods.h"
if [ ! -f "$target_file" ]; then
echo " ⚠️ MovePath patch target file missing: $target_file"
return 1
fi
if grep -q 'MoveWaypoint(creature->GetWaypointPath(), true);' "$target_file"; then
if sed -i 's/MoveWaypoint(creature->GetWaypointPath(), true);/MovePath(creature->GetWaypointPath(), FORCED_MOVEMENT_RUN);/' "$target_file"; then
echo " ✅ Applied MovePath compatibility fix"
return 0
else
echo " ❌ Failed to apply MovePath compatibility fix"
return 2
fi
else
echo " ✅ MovePath compatibility fix already present"
return 0
fi
}
# Apply all patches
patch_count=0
if apply_movepath_patch; then
patch_count=$((patch_count + 1))
fi
if [ $patch_count -eq 0 ]; then
echo " No patches needed or applied"
exit 0
fi
echo " ✅ Applied $patch_count compatibility patch(es)"
exit 0