1
0
Files
configuration
flake
hosts
lib
modules
pkgs
chromium-incognito
clerie-backup
clerie-keys
clerie-sops
clerie-system-remote-install
clerie-system-upgrade
clerie-update-nixfiles
factorio-launcher
default.nix
launch-factorio.sh
feeds-dir
git-checkout-github-pr
git-diff-word
git-pp
git-show-link
iot-data
nix-remove-result-links
nixfiles
overrides
print-afra
run-with-docker-group
ssh-gpg
update-from-hydra
uptimestatus
overlay.nix
pkgs.nix
profiles
users
.gitignore
README.md
flake.lock
flake.nix
nixfiles/pkgs/factorio-launcher/launch-factorio.sh

29 lines
527 B
Bash

#!/usr/bin/env bash
set -euo pipefail
if [[ $# -eq 0 ]]; then
echo "Pass path to factorio install directory as first argument"
exit 1
fi
FACTORIO_BINARY_PATH=""
for suffix in "" "/factorio" "/x64/factorio" "/bin/x64/factorio" "/factorio/bin/x64/factorio"; do
if [[ -f "$1${suffix}" && -x "$1${suffix}" ]]; then
FACTORIO_BINARY_PATH="$1${suffix}"
break
fi
done
if [[ -z $FACTORIO_BINARY_PATH ]]; then
echo "No factorio executable found below $1"
exit 1
fi
shift
set -- "${FACTORIO_BINARY_PATH}" "$@"
exec "$@"