--- a/apalache-mc +++ b/apalache-mc @@ -6,29 +6,22 @@ # packaged produced. # # Igor Konnov, Shon Feder 2018-2022 +# +# Patch for system install +# Ranadeep B # See https://sipb.mit.edu/doc/safe-shell/ set -euf -o pipefail -# The directory where the script is run from -# See https://stackoverflow.com/a/246128/1187277 -SOURCE=${BASH_SOURCE[0]} -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR="/usr/share/java/apalache" -APALACHE_JAR=${APALACHE_JAR:-"$DIR/../lib/apalache.jar"} +APALACHE_JAR=${APALACHE_JAR:-"${DIR}/apalache.jar"} JVM_ARGS=${JVM_ARGS:-""} if ! test -f "$APALACHE_JAR" then - echo "ERROR: No file found at ${APALACHE_JAR}" - echo " Ensure you have run 'make package' and are running the script from the" - echo " distribution pacakge, or else set APALACHE_JAR to point to your custom" - echo " build jar." + echo "ERROR: Distribution jar not found. Is the jar file present in \"$DIR\"?" + exit 1 fi # Check of the heap size is already set @@ -41,9 +34,9 @@ # Check whether the CLI args contains the debug flag if [[ "$*" =~ '--debug' ]] then - echo "# Tool home: $DIR" + echo "# Tool home: system" echo "# Package: $APALACHE_JAR" - echo "# JVM args: $JVM_ARGS" + echo "# JVM args: $JVM_ARGS" echo "#" fi