sdrangel: fix build on x86_64-darwin
[NixPkgs.git] / pkgs / games / openra_2019 / mod-launch-game.sh
blob16fb14c24d656b5997e61bcc6653564abd097180
1 #!/usr/bin/env bash
2 show_error() {
3 if command -v zenity > /dev/null; then
4 zenity --no-wrap --no-markup --error --title "OpenRA - @title@" --text "$1" 2>/dev/null
5 else
6 printf "$1\n" >&2
7 fi
8 exit 1
11 pushd "@out@/lib/openra_2019-@name@" > /dev/null
13 # Check for missing assets
14 assetsError='@assetsError@'
15 if [[ -n "$assetsError" && ! -d "$HOME/.openra/Content/@name@" ]]; then
16 show_error "$assetsError"
19 # Run the game
20 mono --debug OpenRA.Game.exe Game.Mod=@name@ Engine.LaunchPath="@out@/bin/openra-@name@" Engine.ModSearchPaths="@out@/lib/openra_2019-@name@/mods" "$@"
22 # Show a crash dialog if something went wrong
23 if (( $? != 0 && $? != 1 )); then
24 show_error $'OpenRA - @title@ has encountered a fatal error.\nPlease refer to the crash logs for more information.\n\nLog files are located in ~/.openra/Logs'