Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup wrapper script that launches IDE #1039

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions zbstudio/zbstudio.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash
#!/usr/bin/env sh

if [[ "$(uname -m)" == "x86_64" ]]; then ARCH="x64"; else ARCH="x86"; fi
CWD="$PWD" # save the current directory, as it's going to change
# Stash the current PWD so we can pass it to the IDE, the
# IDE itself will be launched from it's own location
CWD="$PWD"

(cd "@IDE_DATADIR@"; bin/linux/$ARCH/lua src/main.lua zbstudio -cwd "$CWD" "$@" 2>/dev/null) &
# Figure out which architecture binary is approprate for the host system
case $(uname -m) in
*64) ARCH="x64" ;;
*) ARCH="x86" ;;
esac

# Lua executable to run, can be overridden with ENV variable
: ${LUA_EXECUTABLE:="bin/linux/$ARCH/lua"}

cd "@IDE_DATADIR@"
exec "$LUA_EXECUTABLE" src/main.lua zbstudio -cwd "$CWD" "$@"