From 9cb1a516f9308e70b99046ee803e5d87d2ca0ba8 Mon Sep 17 00:00:00 2001 From: "Kevin @ Sesam Solutions" <56027840+KevinAtSesam@users.noreply.github.com> Date: Wed, 8 May 2024 02:51:27 +0200 Subject: [PATCH] Use POSIX compliant `command -v` (#498) This removes the `which` package dependency, allowing Linux containers to run with this additional package. --- src/main/twirl/xerial/sbt/pack/launch.scala.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/twirl/xerial/sbt/pack/launch.scala.txt b/src/main/twirl/xerial/sbt/pack/launch.scala.txt index 2141c21e..c86321dc 100644 --- a/src/main/twirl/xerial/sbt/pack/launch.scala.txt +++ b/src/main/twirl/xerial/sbt/pack/launch.scala.txt @@ -60,16 +60,16 @@ case "`uname`" in JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home fi JAVA_OPTS="$JAVA_OPTS -Xdock:name=\"${PROG_NAME}\" -Xdock:icon=\"$PROG_HOME/@(opts.MAC_ICON_FILE)\" -Dapple.laf.useScreenMenuBar=true" - JAVACMD="`which java`" + JAVACMD="`command -v java`" ;; esac # Resolve JAVA_HOME from javac command path if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" + javaExecutable="`command -v javac`" if [ -n "$javaExecutable" -a -f "$javaExecutable" -a ! "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` + readLink=`command -v readlink` if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then javaExecutable="`readlink -f \"$javaExecutable\"`" javaHome="`dirname \"$javaExecutable\"`" @@ -90,7 +90,7 @@ if [ -z "$JAVACMD" ] ; then JAVACMD="$JAVA_HOME/bin/java" fi else - JAVACMD="`which java`" + JAVACMD="`command -v java`" fi fi