#!/usr/bin/env bash # Launches System Shock. Copied next to the systemshock binary in dist/ # by the root Makefile. set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" export LD_LIBRARY_PATH="$(pwd)/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" # Not `exec`: piping through tee needs this script's own process to stay # around as the pipeline. `pipefail` (set above) still makes the script # exit with systemshock's own exit code, not tee's. ./systemshock "$@" 2>&1 | tee "$(pwd)/systemshock.log"