= fix, shellcheck false positive

This commit is contained in:
Lucas Briese 2019-07-29 21:53:55 +02:00
parent 6c65b855a5
commit 45b4d0235b

View File

@ -19,13 +19,15 @@ else
mkdir -p "$LUA_PATH" mkdir -p "$LUA_PATH"
fi fi
if [ "$WORKSHOP_COLLECTION_ID" = "0" ] || [ "$WORKSHOP_COLLECTION_ID" = "" ]; then if [ "$WORKSHOP_COLLECTION_ID" = "0" ] || [ "$WORKSHOP_COLLECTION_ID" = "" ] || [ "$WORKSHOP_AUTOLOAD" != "true" ]; then
echo "given ID is default, no workshop download" echo "No auto workshop download"
else else
touch "$LUA_FILE" 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+' ) 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="" str=""
for i in "${arr[@]}" # resplitting needed here, otherwise one string with complete ids
# shellcheck disable=SC2068
for i in ${arr[@]}
do do
str=${str}"resource.AddWorkshop( \"${i}\" )"$'\n' str=${str}"resource.AddWorkshop( \"${i}\" )"$'\n'
done done