diff options
-rw-r--r-- | src/lpm.lua | 2 | ||||
-rw-r--r-- | t/run.lua | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index a950e27..f81f69c 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -586,7 +586,7 @@ function Addon.new(repository, metadata) }, metadata), Addon) self.type = type -- Directory. - self.organization = metadata.organization or (((self.files and #self.files > 0) or self.remote or (not self.path and not self.url)) and "complex" or "singleton") + self.organization = metadata.organization or (((self.files and #self.files > 0) or self.remote or (not self.path and not self.url) or (self.path and not self.path:find("%.lua$"))) and "complex" or "singleton") if not self.local_path and repository then if metadata.remote then local local_path = (Repository.url(metadata.remote).local_path .. (metadata.path and (PATHSEP .. metadata.path:gsub("^/", "")) or "")) @@ -45,6 +45,9 @@ local tests = { assert_exists(userdir .. "/plugins/plugin_manager/init.lua") actions = lpm("uninstall plugin_manager")["actions"] assert_not_exists(userdir .. "/plugins/plugin_manager") + lpm("install editorconfig") + assert_exists(userdir .. "/plugins/editorconfig") + assert_exists(userdir .. "/plugins/editorconfig/init.lua") end, ["03_upgrade_complex"] = function() local actions = lpm("install plugin_manager") @@ -81,7 +84,12 @@ local tests = { local actions = lpm("install encodings") assert_exists(userdir .. "/plugins/encodings.lua") local stat = system.stat(userdir .. "/plugins/encodings.lua") + assert(stat) assert(stat.type == "file") + assert_exists(userdir .. "/libraries/encoding") + stat = system.stat(userdir .. "/libraries/encoding") + assert(stat) + assert(stat.type == "dir") end, ["07_manifest"] = function() local results = json.decode(io.open("manifest.json", "rb"):read("*all")) |