-
Notifications
You must be signed in to change notification settings - Fork 3
/
sst
executable file
·27 lines (23 loc) · 902 Bytes
/
sst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Check if installed locally (main.lua is in the same directory as this script) or in the system (main.lua is in /usr/share/simplesteammod)
if [ -f "$(dirname $0)/main.lua" ]; then
# Installed locally
SCRIPT_PATH="$(dirname $0)"
elif [ -f "/usr/share/SimpleSteamTinker/main.lua" ]; then
# Installed in the system
SCRIPT_PATH="/usr/share/SimpleSteamTinker"
else
echo "main.lua not found. Please install SimpleSteamTinker and try again."
exit 1
fi
# Set LUA_PATH to avoid missing require issues, using the detected directory
export LUA_PATH="$SCRIPT_PATH/?.lua;$SCRIPT_PATH/?/init.lua;;"
# Provide script directory
export SST_SCRIPT_PATH="$SCRIPT_PATH/"
# Check if Lua is installed and run main.lua, accounting for the script path
if [ -x "$(command -v lua)" ]; then
lua $SCRIPT_PATH/main.lua "$@"
else
echo "No Lua installation found. Please install Lua and try again."
exit 1
fi