We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a404336 commit d30107bCopy full SHA for d30107b
1 file changed
.vscode/on_editor_save.lua
@@ -1,5 +1,6 @@
1
--ANALYZE
2
require("nattlua.other.lua_compat")
3
+_G.REUSE_BASE_ENV = true
4
local path = ...--[[# as string | nil]]
5
assert(type(path) == "string", "expected path string")
6
local is_lua = path:sub(-4) == ".lua"
@@ -36,6 +37,26 @@ then
36
37
return
38
end
39
40
+if not _G.ROOT_PATH then
41
+ local source = debug.getinfo(1, "S").source:sub(2)
42
+ local start = source:find("%.vscode/on_editor_save%.lua$")
43
+
44
+ if start then
45
+ local root = source:sub(1, start - 1)
46
47
+ if root == "" then
48
+ _G.ROOT_PATH = "./"
49
+ else
50
+ if root:sub(-1) ~= "/" then root = root .. "/" end
51
52
+ _G.ROOT_PATH = root
53
+ end
54
55
56
57
+end
58
59
60
_G.HOTRELOAD = true
61
_G.path = path
62
_G.code = code
0 commit comments