-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfs.lua
More file actions
37 lines (30 loc) · 766 Bytes
/
fs.lua
File metadata and controls
37 lines (30 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require "fs"
local hidden_files = {
"garrysmod/lua/menu/fs.lua"
}
local not_allowed = {}
for k,v in pairs(hidden_files) do
not_allowed[v] = true
end
local override = false
hook.Add("ShouldHideFile", "", function(path)
if (override) then
return false
end
if (not_allowed[path]) then
return true
end
end)
raw_include = raw_include or include
local pak = function(...)
return {n = select("#", ...), ...}
end
local unpak = function(p)
return unpack(p, 1, p.n)
end
include = function(...)
override = true
local rets = pak(CompileString("local t = ... return t(select(2, ...))", debug.getinfo(2).short_src)(raw_include, ...))
override = false
return unpak(rets)
end