diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-12 16:51:37 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-10-12 16:51:37 +0800 |
commit | 5a61b45149be1ecaaa71baac3299180916566574 (patch) | |
tree | 94c08230b07d57a13f54f4edd754b8051952d536 | |
parent | 815a19e0a19a8a46bf7a105b8465f3f7cf1807fa (diff) | |
download | lua-language-server-5a61b45149be1ecaaa71baac3299180916566574.zip |
supports test
-rw-r--r-- | make/bootstrap.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/make/bootstrap.lua b/make/bootstrap.lua index a43ede88..f01646a0 100644 --- a/make/bootstrap.lua +++ b/make/bootstrap.lua @@ -1,4 +1,4 @@ -local main
+local main, exec
local i = 1
while arg[i] do
if arg[i] == '-E' then
@@ -7,13 +7,17 @@ while arg[i] do local expr = assert(arg[i], "'-e' needs argument")
assert(load(expr, "=(command line)"))()
-- exit after the executing
- return
+ exec = true
elseif not main and arg[i]:sub(1, 1) ~= '-' then
main = i
end
i = i + 1
end
+if exec and not main then
+ return
+end
+
if main then
for i = -1, -999, -1 do
if not arg[i] then
@@ -63,7 +67,7 @@ package.searchers[2] = function (name) local f = io.open(filename)
local buf = f:read '*a'
f:close()
- local relative = filename:sub(#root + 2)
+ local relative = filename:sub(1, #root) == root and filename:sub(#root + 2) or filename
local init, err = load(buf, '@' .. relative)
if not init then
return err
|