File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 41
41
package.path = rootPath .. script .. ' /?.lua'
42
42
.. ' ;' .. rootPath .. script .. ' /?/init.lua'
43
43
end
44
+
45
+ package.searchers [2 ] = function (name )
46
+ local filename , err = package.searchpath (name , package.path )
47
+ if not filename then
48
+ return err
49
+ end
50
+ local f = io.open (filename )
51
+ local buf = f :read ' *a'
52
+ f :close ()
53
+ local init , err = load (buf , ' @' .. name )
54
+ if not init then
55
+ return err
56
+ end
57
+ return init , filename
58
+ end
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ m.size = 0
22
22
m .maxSize = 100 * 1024 * 1024
23
23
24
24
local function trimSrc (src )
25
- src = src :sub (m . prefixLen + 3 , - 5 )
26
- src = src :gsub ( ' ^[/ \\ ]+ ' , ' ' )
27
- src = src : gsub ( ' [ \\ /]+ ' , ' . ' )
25
+ if src :sub (1 , 1 ) == ' @ ' then
26
+ src = src :sub ( 2 )
27
+ end
28
28
return src
29
29
end
30
30
You can’t perform that action at this time.
0 commit comments