Last active
August 29, 2015 13:57
-
-
Save letharion/9819294 to your computer and use it in GitHub Desktop.
Rimworld launcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Launcher for the Linux version of RimWorld | |
set -o nounset | |
set -o errexit | |
cd `dirname $0` | |
main() { | |
# Defaults | |
local GAMEFILE=`find . -maxdepth 1 -name *86` | |
local LOG="" | |
# Checking if OS is 32 or 64 bits and adjusting the game executable name accordingly. | |
local OSVERSION=`uname -m` | |
if [ "${OSVERSION}" = "x86_64" ]; then | |
GAMEFILE=${GAMEFILE}_64 | |
fi | |
# Ensure the executable is actually executable. | |
if [ ! -x "${GAMEFILE}" ]; then | |
chmod +x ${GAMEFILE} | |
fi | |
# If this is a dev version, we want to activate logs. | |
if [ "${GAMEFILE#*Dev*}" != "${GAMEFILE}" ]; then | |
LOG="-logfile /tmp/rimworld_log" | |
fi | |
# Ensure the game starts with the default locale to appease unity. | |
LC_ALL=C ./${GAMEFILE} ${LOG} | |
} | |
main; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment