From 45b4d0235b6cb176dfc27871234c9c9a4555677b Mon Sep 17 00:00:00 2001 From: Lucas Briese Date: Mon, 29 Jul 2019 21:53:55 +0200 Subject: [PATCH] = fix, shellcheck false positive --- gmod/forceWorkshopDownload.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gmod/forceWorkshopDownload.sh b/gmod/forceWorkshopDownload.sh index 0648b76..edb132f 100644 --- a/gmod/forceWorkshopDownload.sh +++ b/gmod/forceWorkshopDownload.sh @@ -19,13 +19,15 @@ else mkdir -p "$LUA_PATH" fi -if [ "$WORKSHOP_COLLECTION_ID" = "0" ] || [ "$WORKSHOP_COLLECTION_ID" = "" ]; then - echo "given ID is default, no workshop download" +if [ "$WORKSHOP_COLLECTION_ID" = "0" ] || [ "$WORKSHOP_COLLECTION_ID" = "" ] || [ "$WORKSHOP_AUTOLOAD" != "true" ]; then + echo "No auto workshop download" else touch "$LUA_FILE" arr=$(wget -q -O - https://steamcommunity.com/sharedfiles/filedetails/?id="${WORKSHOP_COLLECTION_ID}" | tr '\n' ' ' | grep -Po '"workshopItem"[^"]+"https://steamcommunity.com/sharedfiles/filedetails/\?id=(\d+)' | grep -Po '\d\d\d+' ) str="" - for i in "${arr[@]}" + # resplitting needed here, otherwise one string with complete ids + # shellcheck disable=SC2068 + for i in ${arr[@]} do str=${str}"resource.AddWorkshop( \"${i}\" )"$'\n' done