aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-01-17 17:09:16 -0500
committerAdam Harrison <adamdharrison@gmail.com>2023-01-17 17:09:16 -0500
commitc2c049448c4357eeb8474f21e880fd7258d90d80 (patch)
tree8d127dd3951778424568ea3f117dbf5dcb6a3dab /src
parentc73f371caa7c6d2591ba676afd940d53fe852e40 (diff)
downloadlite-xl-plugin-manager-c2c049448c4357eeb8474f21e880fd7258d90d80.tar.gz
lite-xl-plugin-manager-c2c049448c4357eeb8474f21e880fd7258d90d80.zip
Fixed up plugin manager plugin, moving to optimization.
Diffstat (limited to 'src')
-rw-r--r--src/lpm.c1
-rw-r--r--src/lpm.lua6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lpm.c b/src/lpm.c
index 03c19f5..1d66e41 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -969,6 +969,7 @@ int lpm_flock(lua_State* L) {
UnlockFile(file, 0, 0, 1, 0);
CloseHandle(file);
#else
+ flock(fd, LOCK_UN);
close(fd);
#endif
if (err)
diff --git a/src/lpm.lua b/src/lpm.lua
index b100d43..a950e27 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -1478,11 +1478,11 @@ end
local function lpm_addon_list(type, id)
local max_id = 4
- local result = { addons = { } }
+ local result = { [(type or "addon") .. "s"] = { } }
for j,addon in ipairs(common.grep(system_bottle:all_addons(), function(p) return (not type or p.type == type) and (not id or p.id:find(id)) end)) do
max_id = math.max(max_id, #addon.id)
local repo = addon.repository
- table.insert(result.addons, {
+ table.insert(result[(type or "addon") .. "s"], {
id = addon.id,
status = addon.repository and (addon:is_installed(system_bottle) and "installed" or (system_bottle.lite_xl:is_compatible(addon) and "available" or "incompatible")) or (addon:is_bundled(system_bottle) and "bundled" or (addon:is_core(system_bottle) and "core" or (addon:is_upgradable(system_bottle) and "upgradable" or "orphan"))),
version = "" .. addon.version,
@@ -1705,7 +1705,7 @@ It has the following commands:
path can be specifeid.
lpm lite-xl list Lists all installed versions of
lite-xl.
- lpm run <version> [...addons] Sets up a "bottle" to run the specified
+ lpm run <version> [...addons] Sets up a "bottle" to run the specified
lite version, with the specified addons
and then opens it.
lpm describe [bottle] Describes the bottle specified in the form