aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-01-18 12:21:05 -0500
committerAdam Harrison <adamdharrison@gmail.com>2024-01-18 12:21:05 -0500
commite7bd5c0516f6906e80f74e584762774bfe789a90 (patch)
tree05e89c854679857fb035041a45bb848e63d7a52e /src/lpm.lua
parentdd4119770bc2c90c198f92ed17c0272c2e5e7cd2 (diff)
downloadlite-xl-plugin-manager-e7bd5c0516f6906e80f74e584762774bfe789a90.tar.gz
lite-xl-plugin-manager-e7bd5c0516f6906e80f74e584762774bfe789a90.zip
Added in for case where branch or commit isn't supplied to local manifest repo with a remote.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index db05a92..6118469 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -650,8 +650,9 @@ function Addon.new(repository, metadata)
end
if not self.local_path and repository then
if self.remote then
- local local_path = (Repository.url(self.remote).local_path .. (self.path and (PATHSEP .. self.path:gsub("^/", "")) or ""))
- self.local_path = system.stat(local_path) and (Repository.url(self.remote).local_path .. (self.path and (PATHSEP .. self.path:gsub("^/", "")) or "")) or nil
+ local repo = Repository.url(self.remote)
+ local local_path = repo.local_path and (repo.local_path .. (self.path and (PATHSEP .. self.path:gsub("^/", "")) or ""))
+ self.local_path = local_path and system.stat(local_path) or nil
else
self.local_path = (repository.local_path .. (self.path and (PATHSEP .. self.path:gsub("^/", "")) or "")) or nil
end
@@ -1144,7 +1145,7 @@ function Repository:generate_manifest(repo_id)
end
function Repository:fetch_if_not_present()
- if system.stat(self.local_path) then return self end
+ if self.local_path and system.stat(self.local_path) then return self end
return self:fetch()
end