2 # ---------------------------------------------------------------------------
3 # Multi-Phasic Applications: SquirrelJME
4 # Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 # Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
6 # ---------------------------------------------------------------------------
7 # SquirrelJME is under the Mozilla Public License Version 2.0.
8 # For more information see license.txt.
9 # ---------------------------------------------------------------------------
10 # Brew installation script
12 # Where is this script?
13 __exeDir
="$(dirname -- "$0")"
16 __binDir
="$(readlink -f -- "$1")"
17 __binBinTarget
="$(readlink -f -- "$1")/squirreljme-standalone"
18 __binJarTarget
="$(readlink -f -- "$1")/squirreljme-standalone.jar"
21 __jarDir
="$(readlink -f -- "$2")"
23 # Install only the first highest versioned Jar
25 find "$__jarDir" -type f |
grep '\.jar$' |
grep 'squirreljme-standalone' |
26 sort -r |
head -n 1 |
while read __jar
28 # Determine the base name of the JAR
29 __baseName
="$(basename -- "$__jar")"
31 # Copy the JAR to the target
32 cp -vf "$__jar" "$__binJarTarget"
34 # Add script to launch it
35 cat << EOF > "$__binBinTarget"
37 java -jar "\$(dirname -- "\$0")/squirreljme-standalone.jar" "\$@"
42 chmod +x
"$__binBinTarget"