diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-06-09 13:11:27 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-06-09 13:11:27 -0400 |
commit | 259331a015432cfd47eb5c6161c6ddf05288a01c (patch) | |
tree | 7fbbeef5cd8123e3416b8270c740adbb5a072fef /src/lpm.lua | |
parent | 5343f4820b5acf49da65b1ea635d2f42d0292c16 (diff) | |
download | lite-xl-plugin-manager-259331a015432cfd47eb5c6161c6ddf05288a01c.tar.gz lite-xl-plugin-manager-259331a015432cfd47eb5c6161c6ddf05288a01c.zip |
Relaxed detection of datadir and core plugins to probably fix #112.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index f17fcb8..901c02e 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1603,20 +1603,18 @@ function Bottle:all_addons() end end end - -- If we can't find the datadir, assume that we have the core plugins installed. - if not system.stat(self.lite_xl.datadir_path) then - for id, v in pairs(CORE_PLUGINS) do - if not hash[id] then - table.insert(t, Addon.new(nil, { - id = id, - type = "plugin", - location = "core", - organization = "singleton", - local_path = nil, - mod_version = self.lite_xl.mod_version, - path = "plugins" .. PATHSEP .. id .. ".lua" - })) - end + -- Ensure we have at least one instance of each core plugin. + for id, v in pairs(CORE_PLUGINS) do + if not hash[id] then + table.insert(t, Addon.new(nil, { + id = id, + type = "plugin", + location = "core", + organization = "singleton", + local_path = nil, + mod_version = self.lite_xl.mod_version, + path = "plugins" .. PATHSEP .. id .. ".lua" + })) end end self.all_addons_cache = t |