diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lpm.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index e8eb844..23ad06d 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -664,7 +664,7 @@ function Addon:unstub() if not self:is_stub() or self.inaccessible then return end local repo local status, err = pcall(function() - repo = Repository.url(self.remote):fetch() + repo = Repository.url(self.remote):fetch_if_not_present() local manifest = repo:parse_manifest(self.id) local remote_entry = common.grep(manifest['addons'] or manifest['plugins'], function(e) return e.id == self.id end)[1] if not remote_entry then error("can't find " .. self.type .. " on " .. self.remote) end @@ -1142,6 +1142,11 @@ function Repository:generate_manifest(repo_id) common.write(path .. PATHSEP .. "manifest.json", json.encode({ addons = addons })) end +function Repository:fetch_if_not_present() + if system.stat(self.local_path) then return end + return self:fetch() +end + -- useds to fetch things from a generic place function Repository:fetch() if self:is_local() then return self end |