Fixed locating of CF modpack server jar when not using server script

#842
This commit is contained in:
Geoff Bourne 2021-04-24 13:41:18 -05:00
parent 5f48a4e5e5
commit 65b3997e72

View file

@ -60,8 +60,8 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
mkdir -p ${FTB_BASE_DIR}
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "$serverJar" ]]; then
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "$SERVER" ]]; then
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
@ -89,14 +89,15 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
fi
echo "${FTB_SERVER_MOD}" > $installMarker
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
fi
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
log "ERROR unable to locate installed forge server jar"
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
exit 2
fi
export SERVER
export FTB_DIR=$(dirname "${SERVER}")