#!/usr/bin/env bash # Launches System Shock with every mod built under modding/dist/mods/ # applied (see modding/README.md section 4). Each mod's own # modding/dist/mods//mod/ folder is passed to run.sh as a separate, # absolute argument - the engine's ProcessModDirectory() # (engine/src/MacSrc/Modding.c) only scans one directory level deep, so it # can never be pointed at modding/dist/mods/ itself and find the mods nested # a level further inside, and a relative argument would resolve against the # wrong directory once run.sh changes into its own. set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" MODS_DIR="$(pwd)/../modding/dist/mods" MOD_ARGS=() if [ -d "$MODS_DIR" ]; then for mod in "$MODS_DIR"/*/mod; do [ -d "$mod" ] && MOD_ARGS+=("$(cd "$mod" && pwd)") done fi exec ./run.sh "${MOD_ARGS[@]}" "$@"