Improved locating of forge server jar created by installer

#799
This commit is contained in:
Geoff Bourne 2021-03-11 19:40:11 -06:00
parent 44138564b0
commit e659343821

View file

@ -46,6 +46,8 @@ elif [[ -z $FORGE_INSTALLER ]]; then
elif [[ ! -e $FORGE_INSTALLER ]]; then
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
exit 2
else
shortForgeVersion=$VANILLA_VERSION-custom
fi
installMarker="/data/.forge-installed-$shortForgeVersion"
@ -98,7 +100,11 @@ if [ ! -e $installMarker ]; then
log "Finding installed server jar..."
unset -v latest
for file in *forge*.jar; do
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
if ! [[ $file =~ installer ]]; then
if [[ -z $latest ]] || [[ $file -nt $latest ]]; then
latest=$file
fi
fi
done
if [[ -z $latest ]]; then
log "Unable to derive server jar for Forge"