Files
factorio/scripts/disable-recycler.sh
T
feedc0de df6af9d0d1
Validate, publish and promote Factorio chart / chart (push) Successful in 18s
Disable Factorio recycler on vanilla server
2026-10-27 08:04:47 +01:00

20 lines
491 B
Bash

#!/bin/bash
set -euo pipefail
mod_list=${1:-/factorio/mods/mod-list.json}
mkdir -p "$(dirname "$mod_list")"
if [[ ! -s "$mod_list" ]]; then
printf '{"mods":[{"name":"base","enabled":true}]}\n' > "$mod_list"
fi
tmp_file="${mod_list}.tmp"
jq '
if (.mods | map(.name) | index("recycler")) then
.mods |= map(if .name == "recycler" then .enabled = false else . end)
else
.mods += [{"name":"recycler","enabled":false}]
end
' "$mod_list" > "$tmp_file"
mv "$tmp_file" "$mod_list"