Made launcher scripts on OSX find java the recommended way

This commit is contained in:
Vhati 2017-12-31 15:19:13 -05:00
parent e94d553c22
commit a999e1e804
4 changed files with 29 additions and 5 deletions

View file

@ -22,7 +22,8 @@
"Added a Validate warning about FTL 1.5.13 for chars outside windows-1252",
"Disabled XML escaping when reencoding to ensure invalid chars cause an error",
"Changed logging framework to SLF4J/Logback",
"Changed command line parser to picocli"
"Changed command line parser to picocli",
"Made launcher scripts on OSX find java the recommended way"
]
},
{

View file

@ -9,6 +9,7 @@ Changelog
- Added a Validate warning about FTL 1.5.13 for chars outside windows-1252
- Changed logging framework to SLF4J/Logback
- Changed command line parser to picocli
- Made launcher scripts on OSX find java the recommended way
1.9:
- Fixed corrupted civilian sector music in FTL 1.6.1+

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Get the absolute path to this script's folder.
if echo "$0" | awk '{exit(!/^\//);}'; then
@ -8,4 +8,13 @@ else
fi
cd "${maindir}";
java -jar modman.jar "$@";
java_cmd=$(command -v java);
# OSX uses a command to decide java's location.
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME=`/usr/libexec/java_home`
java_cmd=${JAVA_HOME}/bin/java
fi
${java_cmd} -jar modman.jar "$@";

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Get the script's name.
me=$(basename "$0");
@ -46,7 +46,20 @@ fi
# Finally, the payload.
cd "${maindir}";
# - - -
java -jar modman.jar;
java_cmd=$(command -v java);
# OSX uses a command to decide java's location.
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME=`/usr/libexec/java_home`
java_cmd=${JAVA_HOME}/bin/java
fi
echo "";
echo "Found java at: ${java_cmd}";
echo "";
${java_cmd} -jar modman.jar;
# - - -
if [ "${ingui}" = "1" ]; then