From 4bd9da569a076ade4d1a20fd6f6508fe3b094aaf Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Wed, 16 Sep 2015 19:29:01 +1000 Subject: [PATCH] Move mod extraction to out of doInstallMod --- tools/arkmanager | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 383b3fd..577c8f6 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -595,14 +595,14 @@ doDownloadMod(){ } # -# Downloads mod and installs it into mods directory +# Extracts a mod into the ARK Mods directory # -doInstallMod(){ +doExtractMod(){ local modid=$1 local modsrcdir="$steamcmdroot/steamapps/workshop/content/$mod_appid/$modid" local moddestdir="$arkserverroot/ShooterGame/Content/Mods/$modid" - if doDownloadMod $modid; then + if [ -f "$modsrcdir/mod.info" ]; then echo "Copying files to $moddestdir" if [ -f "$modsrcdir/LinuxNoEditor/mod.info" ]; then modsrcdir="$modsrcdir/LinuxNoEditor" @@ -667,7 +667,17 @@ doInstallMod(){ else echo -ne '\x01\x00\x00\x00\x08\x00\x00\x00ModType\x00\x02\x00\x00\x001\x00' >>"$moddestdir/.mod" fi + fi +} +# +# Downloads mod and installs it into mods directory +# +doInstallMod(){ + local modid=$1 + + if doDownloadMod $modid; then + doExtractMod $modid echo "Mod $modid installed" fi }