lgen.lua

changeset 21
3c71c525cec2
parent 9
751216807683
child 26
77cd7b8fb6a6
equal deleted inserted replaced
20:3b937ef20faa 21:3c71c525cec2
1 1
2 local path=string.gsub(arg[0], "(.*)/[^/]*", "%1"); 2 local lgen={}
3 if path~=nil then 3 local lgen_path=string.gsub(arg[0], "(.*)/[^/]*", "%1");
4 package.path=package.path .. ';' .. path .. '/?.lua' 4 if lgen_path~=nil then
5 package.path=package.path .. ';' .. lgen_path .. '/?.lua'
5 end 6 end
6 7
7 -- Lua 5.1 setfenv/getfenv compatibility for Lua 5.2 8 -- Lua 5.1 setfenv/getfenv compatibility for Lua 5.2
8 -- This is required by the "obsolete" ltp module 9 -- This is required by the "obsolete" ltp module
9 local CE = require('compat_env') 10 local CE = require('compat_env')
37 local env={ 38 local env={
38 paths={ 39 paths={
39 src=src, 40 src=src,
40 dst=dst, 41 dst=dst,
41 tmpl=tmpl, 42 tmpl=tmpl,
43 lgen_location=lgen_path,
42 }, 44 },
43 pages={ 45 pages={
44 }, 46 },
45 } 47 }
46 48

mercurial