Commit a9ea2607 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

set package path in development mode

parent 6189314d
...@@ -114,6 +114,12 @@ if not mode then ...@@ -114,6 +114,12 @@ if not mode then
end end
dev_mode = stringy.endswith(arg[0], '/awall-cli')
if dev_mode then
basedir = arg[0]:sub(1, -11)
package.path = basedir..'/?/init.lua;'..basedir..'/?.lua;'..package.path
end
util = require('awall.util') util = require('awall.util')
contains = util.contains contains = util.contains
printmsg = util.printmsg printmsg = util.printmsg
...@@ -139,8 +145,7 @@ for i, cls in ipairs{'mandatory', 'optional', 'private'} do ...@@ -139,8 +145,7 @@ for i, cls in ipairs{'mandatory', 'optional', 'private'} do
if path then pol_paths[cls] = util.split(path, ':') end if path then pol_paths[cls] = util.split(path, ':') end
end end
if stringy.endswith(arg[0], '/awall-cli') then if dev_mode then
basedir = arg[0]:sub(1, -11)
util.setdefault(pol_paths, 'mandatory', {'/etc/awall'}) util.setdefault(pol_paths, 'mandatory', {'/etc/awall'})
table.insert(pol_paths.mandatory, basedir..'/json') table.insert(pol_paths.mandatory, basedir..'/json')
end end
......
awall/init.lua
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment