Files
factorio/scripts/disable-recycler.sh
T

19 lines
491 B
Bash
Raw Normal View History

2026-10-27 08:04:47 +01:00
#!/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"