From b1c51396045f49381a802b33986c0026bfb5f33d Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 16 Sep 2022 23:02:27 -0400 Subject: Fixed some minor issues. --- lpm.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lpm.lua') diff --git a/lpm.lua b/lpm.lua index 4d2eeac..f08e7d0 100644 --- a/lpm.lua +++ b/lpm.lua @@ -512,7 +512,7 @@ function Plugin.new(repository, metadata) install_path = USERDIR .. PATHSEP .. folder .. PATHSEP .. (metadata.path and common.basename(metadata.path):gsub("%.lua$", "") or metadata.name), }, metadata), Plugin) -- Directory. - self.organization = (self.files or self.remote or not self.path) and "complex" or "singleton" + self.organization = ((self.files and #self.files > 0) or self.remote or not self.path) and "complex" or "singleton" if self.organization == "singleton" then self.install_path = self.install_path .. ".lua" end local stat = system.stat(self.install_path) local compatible = (not metadata.mod_version or tonumber(metadata.mod_version) == tonumber(MOD_VERSION)) @@ -603,10 +603,10 @@ local core_plugins = { } function Plugin:install(installing) + if self.status == "installed" then error("plugin " .. self.name .. " is already installed") end local status, err = pcall(function() installing = installing or {} installing[self.name] = true - if self.status == "installed" then error("plugin " .. self.name .. " is already installed") end local compatible, incompatible = self:get_compatibilities() for plugin, version in pairs(self.dependencies) do if incompatible[plugin] then error("can't install " .. self.name .. ": incompatible with " .. incompatible[plugin][1].name .. ":" .. incompatible[plugin][1].version) end @@ -662,7 +662,7 @@ function Plugin:install(installing) end end) if not status then - common.rmrf(self.local_path) + common.rmrf(self.install_path) error(err) end end -- cgit v1.2.3