diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-01-11 20:08:12 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-01-11 20:08:12 -0500 |
commit | 41cbddaa9c327f9f5f80524597cffa99ad4eb445 (patch) | |
tree | 79abfd438a835318e823a99de782a7bd80816eb4 /src | |
parent | cbe8639a92a243786b20018666f0289a8b02e025 (diff) | |
download | lite-xl-plugin-manager-41cbddaa9c327f9f5f80524597cffa99ad4eb445.tar.gz lite-xl-plugin-manager-41cbddaa9c327f9f5f80524597cffa99ad4eb445.zip |
Included json library, and also added in additional code to disambiguate plugins.
Diffstat (limited to 'src')
-rw-r--r-- | src/lpm.lua | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 33929b0..1a2d001 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -562,7 +562,7 @@ function Plugin.new(repository, metadata) version = "1.0", dependencies = {}, conflicts = {}, - local_path = repository and (repository.local_path .. PATHSEP .. (repository.commit or repository.branch) .. (metadata.path and (PATHSEP .. metadata.path:gsub("^/", "")) or "")), + local_path = repository and not metadata.remote and (repository.local_path .. PATHSEP .. (repository.commit or repository.branch) .. (metadata.path and (PATHSEP .. metadata.path:gsub("^/", "")) or "")), name = metadata.id }, metadata), Plugin) self.type = type @@ -1093,7 +1093,21 @@ local function get_repository_plugins() table.insert(t, p) hash[id] = p if not hash[p.id] then hash[p.id] = {} end - table.insert(hash[p.id], p ) + table.insert(hash[p.id], p) + elseif hash[id].remote and not p.remote then + for k,v in ipairs(t) do + if v == hash[id] then + t[k] = p + break + end + end + for k,v in ipairs(hash[p.id]) do + if v == hash[id] then + hash[p.id][k] = p + hash[id] = p + break + end + end end end return t, hash @@ -1122,7 +1136,6 @@ function Bottle:all_plugins() organization = (v:find("%.lua$") and "singleton" or "complex"), mod_version = self.lite_xl.mod_version, path = "plugins" .. PATHSEP .. v, - version = "1.0", description = (hash[id] and hash[id][1].description or nil) })) end @@ -1413,7 +1426,7 @@ local function lpm_plugin_list(id) version = "" .. plugin.version, dependencies = plugin.dependencies, description = plugin.description, - author = plugin.author or (plugin:is_core(system_bottle) and "lite-xl"), + author = plugin.author or (plugin:is_core(system_bottle) and "lite-xl") or nil, mod_version = plugin.mod_version, tags = plugin.tags, type = plugin.type, |