commit 7ba8ab69555b01a8fd60b087277613f93cc267e8 from: Sergey Bronnikov date: Tue Jan 17 15:33:56 2023 UTC Add a shell script that runs JAR file ``` $ ./elle-cli Usage: elle-cli --help $ ./elle-cli --help elle-cli - command-line transactional safety checker. Usage: elle-cli -m model [options] files Supported models: ... ``` commit - cbecaf441b3faef4cb1d14bf165216bd64680b1d commit + 7ba8ab69555b01a8fd60b087277613f93cc267e8 blob - 85c1416e60561d1d4751aee1e6671479f1beb541 blob + 7ed4ccf3b66c71accbe42730fcf008cb5d75149f --- CHANGELOG.md +++ CHANGELOG.md @@ -10,6 +10,8 @@ change log follows the conventions of ### Added +- Shell script that runs a JAR file. + ### Fixed ### Changed blob - /dev/null blob + 1c12a4b696bb5894e85d6952552b742cb3af9451 (mode 755) --- /dev/null +++ elle-cli @@ -0,0 +1,30 @@ +#!/bin/sh + +set -eu + +ver="0.1.6" + +options=$* +if test -z "$options"; then + echo "Usage: $(basename "$0") --help" + exit 0 +fi + +java_path=$(readlink -f "$(which java)") +if test -z "$java_path"; then + echo "No Java found." + exit 1 +fi + +jar_name="elle-cli-${ver}-standalone.jar" +jar_path="./${jar_name}" +if [ ! -f "${jar_path}" ]; then + jar_path="./target/${jar_path}" + if [ ! -f "${jar_path}" ]; then + echo "JAR file ($jar_name) is not found!" + exit 1 + fi +fi + +cmd_line="$java_path -jar $jar_path $options" +eval "$cmd_line"