diff --git a/lua/wire/default_data_decompressor.lua b/lua/wire/default_data_decompressor.lua index 9b899391a6..1038c87ee5 100644 --- a/lua/wire/default_data_decompressor.lua +++ b/lua/wire/default_data_decompressor.lua @@ -1,8 +1,13 @@ -- Garry has imposed a file extension whitelist for the Steam Workshop which does not permit the dangerous format .txt -- Therefore, we must store our .txt's in default_data_files.lua, and then extract them when first run +local ignored_dirs = { + ["expression2/tests"] = true, +} + -- Compress all files in addons/wire/data recursively into 1 json string local function ReadDir(root) + if ignored_dirs[root] then return nil end local tab = {} local files,dirs = file.Find("addons/wire/data/"..root.."*","GAME") for _, f in pairs(files) do @@ -16,7 +21,7 @@ local function ReadDir(root) return tab end -- Uncomment and Rename this file to wire/lua/wire/default_data_files.lua to update it -//file.Write("default_data_files.txt", "//"..util.TableToJSON(ReadDir(""))) +-- file.Write("default_data_files.txt", "//"..util.TableToJSON(ReadDir(""))) -- Decompress the json string wire/lua/wire/default_data_files.lua into the corresponding 36+ default data files local function WriteDir(tab) @@ -34,7 +39,7 @@ if not file.Exists("expression2/_helloworld_.txt", "DATA") then local compressed = file.Read("wire/default_data_files.lua","LUA") -- The client cannot read lua files sent by the server (for security?), so clientside this'll only work -- if the client actually has Wiremod installed, though with workshop autodownload that'll be common - if compressed != nil then + if compressed ~= nil then WriteDir(util.JSONToTable(string.sub(compressed, 3))) end end