Skip to content

Instantly share code, notes, and snippets.

@letharion
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letharion/9819294 to your computer and use it in GitHub Desktop.
Save letharion/9819294 to your computer and use it in GitHub Desktop.
Rimworld launcher
#!/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