From 5a61b45149be1ecaaa71baac3299180916566574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 12 Oct 2021 16:51:37 +0800 Subject: supports test --- make/bootstrap.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'make/bootstrap.lua') 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 -- cgit v1.2.3