Files
factorio-docker/docker/files/scenario2map.sh
Florian Kinder 17ec12cb7f Fix shellcheck warnings in entrypoint scripts
- Add shellcheck disable=SC1091 for dynamic source paths
- Quote INSTALLED_DIRECTORY variables to prevent word splitting
- Resolves all reported shellcheck issues in PR review

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 22:31:45 +09:00

34 lines
857 B
Bash
Executable File

#!/bin/bash
set -eoux pipefail
INSTALLED_DIRECTORY=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
mkdir -p "$SAVES"
mkdir -p "$CONFIG"
mkdir -p "$MODS"
mkdir -p "$SCENARIOS"
if [[ ! -f $CONFIG/server-settings.json ]]; then
cp /opt/factorio/data/server-settings.example.json "$CONFIG/server-settings.json"
fi
if [[ ! -f $CONFIG/map-gen-settings.json ]]; then
cp /opt/factorio/data/map-gen-settings.example.json "$CONFIG/map-gen-settings.json"
fi
if [[ ! -f $CONFIG/map-settings.json ]]; then
cp /opt/factorio/data/map-settings.example.json "$CONFIG/map-settings.json"
fi
# Setup ARM64 emulation support
EXEC=""
# shellcheck disable=SC1091
source "${INSTALLED_DIRECTORY}/setup-exec.sh"
exec $EXEC /opt/factorio/bin/x64/factorio \
--scenario2map "$SERVER_SCENARIO"