diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-03-20 11:50:34 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-03-20 11:50:34 -0400 |
commit | 57a17aeff26711a44a214cb0e3c2dc72c84d8e8f (patch) | |
tree | 7c0417b0c7e284c48e9861d53ac561e0a262a6db | |
parent | 753cc1f885786dcebb4ca336a09319b925217c48 (diff) | |
download | lite-xl-plugin-manager-1.2.6.tar.gz lite-xl-plugin-manager-1.2.6.zip |
Made sure we set the metatable corectly.v1.2.6
-rw-r--r-- | src/lpm.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index e4c309b..16f178a 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -2499,15 +2499,14 @@ not commonly used publically. local lpm_plugins_path = HOME .. PATHSEP .. ".config" .. PATHSEP .. "lpm" .. PATHSEP .. "plugins" local lpm_plugins = system.stat(lpm_plugins_path) and common.map(common.grep(system.ls(lpm_plugins_path), function(path) return path:find("%.lua$") end), function(path) return lpm_plugins_path .. PATHSEP .. path end) or {} - local env = { + local env = setmetatable({ EXECUTABLE_EXTENSION = EXECUTABLE_EXTENSION, SHOULD_COLOR = SHOULD_COLOR, HOME = HOME, USERDIR = USERDIR, CACHEDIR = CACHEDIR, JSON = JSON, TABLE = TABLE, HEADER = HEADER, RAW = RAW, VERBOSE = VERBOSE, FILTRATION = FILTRATION, MOD_VERSION = MOD_VERSION, QUIET = QUIET, FORCE = FORCE, REINSTALL = REINSTALL, CONFIG = CONFIG, NO_COLOR = NO_COLOR, AUTO_PULL_REMOTES = AUTO_PULL_REMOTES, ARCH = ARCH, ASSUME_YES = ASSUME_YES, NO_INSTALL_OPTIONAL = NO_INSTALL_OPTIONAL, TMPDIR = TMPDIR, DATADIR = DATADIR, BINARY = BINARY, POST = POST, PROGRESS = PROGRESS, SYMLINK = SYMLINK, REPOSITORY = REPOSITORY, EPHEMERAL = EPHEMERAL, MASK = MASK, Addon = Addon, Repository = Repository, LiteXL = LiteXL, Bottle = Bottle, lpm = lpm, common = common, json = json, log = log, - settings = settings, repositories = repositories, lite_xls = lite_xls, system_bottle = system_bottle, progress_bar_label = progress_bar_label, write_progress_bar = write_progress_bar, - } + settings = settings, repositories = repositories, lite_xls = lite_xls, system_bottle = system_bottle, progress_bar_label = progress_bar_label, write_progress_bar = write_progress_bar + }, { __index = _G, __newindex = function(t, k, v) _G[k] = v end }) for i,v in ipairs(common.concat(ARGS["plugin"] or {}, { common.split(":", os.getenv("LPM_PLUGINS") or "") }, lpm_plugins)) do if v ~= "" then local contents = v:find("^https?://") and common.get(v) or common.read(v) - setmetatable(env, { __index = _G, __newindex = function(t, k, v) _G[k] = v end }) local func, err = load(contents, v, "bt", env) if func then func() |