Skip to content

Commit e32eb67

Browse files
committed
fix loading of kmods when issuing a command
1 parent 29e8e40 commit e32eb67

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/lunatik

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ if command then
9898
os.exit()
9999
end
100100

101+
function lunatik.load()
102+
if not lunatik.probe() then
103+
lunatik.commands.load()
104+
end
105+
end
106+
101107
local function set(t)
102108
local s = {}
103109
for _, key in ipairs(t) do s[key] = true end
@@ -111,6 +117,7 @@ if #arg >= 1 then
111117
local script = arg[2]
112118
local parm = arg[3]
113119
if tokens[token] then
120+
lunatik.load()
114121
local parm = parm and ("," .. parm) or ""
115122
local ret = token == "list" and "return" or ""
116123
local chunk = string.format("%s lunatik.runner.%s('%s'%s)", ret, token, script, parm)
@@ -121,10 +128,7 @@ if #arg >= 1 then
121128
os.exit()
122129
end
123130

124-
if not lunatik.probe() then
125-
lunatik.commands.load()
126-
end
127-
131+
lunatik.load()
128132
local version = lunatik.dostring("return _LUNATIK_VERSION")
129133
lunatik.copyright = version .. " " .. lunatik.copyright
130134

0 commit comments

Comments
 (0)