From 488e478374bbe270efe292fe200b5d724f0969c2 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 25 Apr 2018 20:48:42 -0500 Subject: [PATCH] mc: use newest installed forge jar fixes #211 --- minecraft-server/start-deployForge | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/minecraft-server/start-deployForge b/minecraft-server/start-deployForge index dfc773b9..0024646e 100755 --- a/minecraft-server/start-deployForge +++ b/minecraft-server/start-deployForge @@ -91,22 +91,16 @@ if [ ! -e $installMarker ]; then fi # NOTE $shortForgeVersion will be empty if installer location was given to us echo "Finding installed server jar..." - for j in *forge*.jar; do - echo "...$j" - case $j in - *installer*) - ;; - *) - export SERVER=$j - break - ;; - esac + unset -v latest + for file in *forge*.jar; do + [[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file done - if [[ -z $SERVER ]]; then + if [[ -z $latest ]]; then echo "Unable to derive server jar for Forge" exit 2 fi + export SERVER=$latest echo "Using server $SERVER" echo $SERVER > $installMarker