-
Notifications
You must be signed in to change notification settings - Fork 0
/
stateboard.init.lua
executable file
·28 lines (25 loc) · 1.3 KB
/
stateboard.init.lua
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
#!/usr/bin/env tarantool
require('strict').on()
if package.setsearchroot ~= nil then
package.setsearchroot()
else
-- Workaround for rocks loading in tarantool 1.10
-- It can be removed in tarantool > 2.2
-- By default, when you do require('mymodule'), tarantool looks into
-- the current working directory and whatever is specified in
-- package.path and package.cpath. If you run your app while in the
-- root directory of that app, everything goes fine, but if you try to
-- start stateboard with "tarantool myapp/stateboard.init.lua", it will fail to load
-- its modules, and modules from myapp/.rocks.
local fio = require('fio')
local app_dir = fio.abspath(fio.dirname(arg[0]))
package.path = app_dir .. '/?.lua;' .. package.path
package.path = app_dir .. '/?/init.lua;' .. package.path
package.path = app_dir .. '/.rocks/share/tarantool/?.lua;' .. package.path
package.path = app_dir .. '/.rocks/share/tarantool/?/init.lua;' .. package.path
package.cpath = app_dir .. '/?.so;' .. package.cpath
package.cpath = app_dir .. '/?.dylib;' .. package.cpath
package.cpath = app_dir .. '/.rocks/lib/tarantool/?.so;' .. package.cpath
package.cpath = app_dir .. '/.rocks/lib/tarantool/?.dylib;' .. package.cpath
end
require('cartridge.stateboard').cfg()