diff options
author | Eduardo Julian | 2020-12-04 01:13:01 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-04 01:13:01 -0400 |
commit | 8df63aae42c40ac0413ccfacc3b2e8eb72e00a15 (patch) | |
tree | 5e1eb6833398b8a67a2e3d0db4a615204a25f80f /shell | |
parent | 0205e5146b50ab066d152fccda0fc8cef4eef852 (diff) |
Re-named old luxc-jvm to lux-bootstrapper.
Diffstat (limited to 'shell')
-rwxr-xr-x | shell/lux.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/shell/lux.sh b/shell/lux.sh new file mode 100755 index 000000000..3ff27a556 --- /dev/null +++ b/shell/lux.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +home() { + # Find out where the script is located. + # This is because it is assumed that the Aedifex JAR will be in the same directory. + local SCRIPT_SOURCE="${BASH_SOURCE[0]}" + while [ -h "$SCRIPT_SOURCE" ]; do + # resolve $SCRIPT_SOURCE until the file is no longer a symlink + local SCRIPT_HOME="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" >/dev/null 2>&1 && pwd )" + SCRIPT_SOURCE="$(readlink "$SCRIPT_SOURCE")" + # if $SCRIPT_SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ $SCRIPT_SOURCE != /* ]] && SCRIPT_SOURCE="$SCRIPT_HOME/$SCRIPT_SOURCE" + done + echo "$( cd -P "$( dirname "$SCRIPT_SOURCE" )" >/dev/null 2>&1 && pwd )" +} + +aedifex() { + echo "$(home)/aedifex.jar" +} + +command() { + local COMMAND="" + while [ $# -gt 0 ]; do + COMMAND="$COMMAND $1" + shift + done + echo $COMMAND +} + +java -jar $(aedifex) $(command "$@") + |