Skip to content

Instantly share code, notes, and snippets.

@SpencerSharkey
Created October 24, 2016 01:07
Show Gist options
  • Save SpencerSharkey/6b386fe804ee7ccd85cf9ae615bd6031 to your computer and use it in GitHub Desktop.
Save SpencerSharkey/6b386fe804ee7ccd85cf9ae615bd6031 to your computer and use it in GitHub Desktop.
function loader:AddResourceDirectory(Directory)
-- Msg("AddResourceDirectory: "..Directory.."...\n")
Msg("AddResourceDirectory: "..self.ContentPrefix.."/"..Directory.."/*\n")
local FoundDir = false
for k,v in pairs(file.Find(self.ContentPrefix.."/"..Directory.."/*", "MOD")) do
local File = Directory.."/"..v
if(file.IsDir(self.ContentPrefix.."/"..File, "MOD")) then
FoundDir = true
if(File != ".svn" or File != "unused")then
self:AddResourceDirectory(File)
end
else
local extension = string.Explode(".", File)
if(extension[#extension] != "bz2")then
//Msg("\tresource.AddFile "..File..":")
resource.AddSingleFile(File)
//Msg("Successful\n")
end
end
end
if(!FoundDir) then
//Msg("AddResourceDirectory: Successful\n")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment