This commit is contained in:
Greg DiCristofaro 2022-08-04 16:31:48 -04:00
parent 31c9819763
commit 6cad1a4aca
2 changed files with 8 additions and 7 deletions

View File

@ -55,7 +55,7 @@ fi
ZIP_FILE_NAME=$(basename -- "$APPLICATION_ZIP_PATH")
ZIP_NAME="${ZIP_FILE_NAME%.*}"
APPLICATION_EXTRACTED_PATH=$INSTALL_DIR/$ZIP_NAME
APPLICATION_EXTRACTED_PATH=$INSTALL_DIR/$ZIP_NAME/
if [[ -d $APPLICATION_EXTRACTED_PATH || -f $APPLICATION_EXTRACTED_PATH ]]; then
echo "A file or directory already exists at $APPLICATION_EXTRACTED_PATH" >>/dev/stderr

View File

@ -52,8 +52,9 @@ fi
echo -n "Checking for Java..."
if [ -n "$JAVA_PATH" ]; then
if [ -x "$JAVA_PATH/bin/java" ]; then
sed -Ei '/^#?\s*jdkhome=/d' etc/$(APPLICATION_NAME).conf
echo "jdkhome=$JAVA_PATH" >> etc/$(APPLICATION_NAME).conf
# only works on linux; not os x
sed -Ei '/^#?\s*jdkhome=.*$' "etc/$APPLICATION_NAME.conf"
echo "jdkhome=$JAVA_PATH" >> etc/$APPLICATION_NAME.conf
else
echo "ERROR: Java was not found in $JAVA_PATH."
exit 1