-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathStarRuler2.sh
More file actions
executable file
·33 lines (30 loc) · 978 Bytes
/
StarRuler2.sh
File metadata and controls
executable file
·33 lines (30 loc) · 978 Bytes
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
28
29
30
31
32
33
#!/bin/bash
set -eo pipefail
#Figure out where the script is located
if [[ -L "$0" ]]; then
script_loc="$(readlink "$0")"
else
script_loc="$0"
fi
cd "$(dirname "$script_loc")"
bin_folder="bin"
args=()
for arg in "$@"; do
if [ "$arg" = "--legacy" ]; then
bin_folder="bin_legacy"
else
args+=("$arg")
fi
done
#Execute the right binary for this architecture
if [ "$(uname)" = "Darwin" ]; then
chmod +x ./$bin_folder/osx64/StarRuler2.bin
DYLD_LIBRARY_PATH="./$bin_folder/osx64/:$DYLD_LIBRARY_PATH" exec ./$bin_folder/osx64/StarRuler2.bin "${args[@]}"
elif [ "$(uname -m)" = "x86_64" ]; then
chmod +x ./$bin_folder/lin64/StarRuler2.bin
LD_LIBRARY_PATH="./$bin_folder/lin64/:$LD_LIBRARY_PATH" exec ./$bin_folder/lin64/StarRuler2.bin "${args[@]}"
else
chmod +x ./$bin_folder/lin32/StarRuler2.bin
LD_LIBRARY_PATH="./$bin_folder/lin32/:$LD_LIBRARY_PATH" exec ./$bin_folder/lin32/StarRuler2.bin "${args[@]}"
fi;
# vim: set ff=unix: