Fix SCUM SteamCMD lifecycle install

This commit is contained in:
npc0-hue
2026-08-01 14:47:24 +08:00
parent 0e4dbf26aa
commit e37f00c48a
8 changed files with 56 additions and 14 deletions
+23 -3
View File
@@ -92,9 +92,29 @@ local_debug_seed_lifecycle_scope() {
cp "$source_dir/actions/$action.json" "$scope/actions/$action.json"
fi
done
cp "$true_binary" "$scope/bin/install-server"
cp "$true_binary" "$scope/bin/game-server"
chmod +x "$scope/bin/install-server" "$scope/bin/game-server"
local executable_key
while IFS= read -r executable_key; do
[[ -n "$executable_key" ]] || continue
local executable_target="$scope/$executable_key"
mkdir -p "$(dirname "$executable_target")"
cp "$true_binary" "$executable_target"
chmod +x "$executable_target"
done < <(node - "$scope/actions" <<'NODE'
const fs = require("fs");
const path = require("path");
const actionsDir = process.argv[2];
for (const entry of fs.readdirSync(actionsDir)) {
if (!entry.endsWith(".json")) continue;
const action = JSON.parse(fs.readFileSync(path.join(actionsDir, entry), "utf8"));
const key = action.executableKey;
if (typeof key !== "string" || key.length === 0) continue;
if (path.posix.isAbsolute(key) || key.includes("\\") || key.split("/").includes("..")) {
throw new Error(`unsafe local-debug executableKey: ${key}`);
}
console.log(key);
}
NODE
)
}
local_debug_seed_plugin_lifecycle_template() {