mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-13 00:58:34 +00:00
fixing beastmaster and default lua install
This commit is contained in:
@@ -301,7 +301,7 @@
|
|||||||
"repo": "https://github.com/azerothcore/mod-npc-beastmaster.git",
|
"repo": "https://github.com/azerothcore/mod-npc-beastmaster.git",
|
||||||
"needs_build": true,
|
"needs_build": true,
|
||||||
"type": "cpp",
|
"type": "cpp",
|
||||||
"post_install_hooks": [],
|
"post_install_hooks": ["fix-beastmaster-sql"],
|
||||||
"config_cleanup": [
|
"config_cleanup": [
|
||||||
"npc_beastmaster.conf*"
|
"npc_beastmaster.conf*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ fi
|
|||||||
|
|
||||||
echo "📜 copy-standard-lua: Processing $MODULE_NAME"
|
echo "📜 copy-standard-lua: Processing $MODULE_NAME"
|
||||||
|
|
||||||
# Create target directory
|
# Create target directory if possible
|
||||||
mkdir -p "$LUA_SCRIPTS_TARGET" 2>/dev/null || {
|
if ! mkdir -p "$LUA_SCRIPTS_TARGET" 2>/dev/null; then
|
||||||
echo "⚠️ copy-standard-lua: Cannot create target directory $LUA_SCRIPTS_TARGET"
|
echo "ℹ️ copy-standard-lua: Target directory $LUA_SCRIPTS_TARGET not accessible (will be copied during container build)"
|
||||||
exit 1
|
exit 0
|
||||||
}
|
fi
|
||||||
|
|
||||||
copied_count=0
|
copied_count=0
|
||||||
|
|
||||||
|
|||||||
36
scripts/hooks/fix-beastmaster-sql
Executable file
36
scripts/hooks/fix-beastmaster-sql
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Post-install hook to fix beastmaster SQL duplicate key issue
|
||||||
|
set -e
|
||||||
|
|
||||||
|
MODULE_DIR="${MODULE_DIR:-}"
|
||||||
|
MODULE_NAME="${MODULE_NAME:-}"
|
||||||
|
|
||||||
|
if [ -z "$MODULE_DIR" ] || [ ! -d "$MODULE_DIR" ]; then
|
||||||
|
echo "❌ fix-beastmaster-sql: Invalid module directory: $MODULE_DIR"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "🔧 fix-beastmaster-sql: Patching SQL file for $MODULE_NAME"
|
||||||
|
|
||||||
|
SQL_FILE="$MODULE_DIR/data/sql/db-world/beastmaster_tames_inserts.sql"
|
||||||
|
|
||||||
|
if [ ! -f "$SQL_FILE" ]; then
|
||||||
|
echo " ℹ️ SQL file not found, skipping: $SQL_FILE"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if already patched
|
||||||
|
if grep -q "INSERT IGNORE INTO" "$SQL_FILE" 2>/dev/null; then
|
||||||
|
echo " ✅ SQL file already patched"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply patch to make SQL idempotent
|
||||||
|
if sed -i 's/^INSERT INTO beastmaster_tames/INSERT IGNORE INTO beastmaster_tames/g' "$SQL_FILE"; then
|
||||||
|
echo " ✅ Patched SQL file to use INSERT IGNORE"
|
||||||
|
else
|
||||||
|
echo " ⚠️ Failed to patch SQL file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user