diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2017-06-05 13:24:57 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2017-06-05 13:24:57 +0300 |
commit | a9ea2607a085e4c0e032234888b2c7f6cfb3ae53 (patch) | |
tree | b70e5b65d3be26f34a6fa4c9c35ad8f0c1ef465e | |
parent | 6189314db2e369b1c576305b981c9e1eae1b16ee (diff) | |
download | awall-a9ea2607a085e4c0e032234888b2c7f6cfb3ae53.tar.bz2 awall-a9ea2607a085e4c0e032234888b2c7f6cfb3ae53.tar.xz |
set package path in development modev1.4.4
-rwxr-xr-x | awall-cli | 9 | ||||
l--------- | awall.lua | 1 |
2 files changed, 7 insertions, 3 deletions
@@ -114,6 +114,12 @@ if not mode then 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') contains = util.contains printmsg = util.printmsg @@ -139,8 +145,7 @@ for i, cls in ipairs{'mandatory', 'optional', 'private'} do if path then pol_paths[cls] = util.split(path, ':') end end -if stringy.endswith(arg[0], '/awall-cli') then - basedir = arg[0]:sub(1, -11) +if dev_mode then util.setdefault(pol_paths, 'mandatory', {'/etc/awall'}) table.insert(pol_paths.mandatory, basedir..'/json') end diff --git a/awall.lua b/awall.lua deleted file mode 120000 index 9a3d9cc..0000000 --- a/awall.lua +++ /dev/null @@ -1 +0,0 @@ -awall/init.lua
\ No newline at end of file |