Merge branch 'folke:main' into patch-1

This commit is contained in:
palandovalex 2024-12-05 12:29:05 +03:00 committed by GitHub
commit b1a2b1c03b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 124 additions and 86 deletions

View file

@ -80,6 +80,7 @@ function M.install(opts)
opts = M.opts(opts, { mode = "install" })
return M.run({
pipeline = {
"plugin.exists",
"git.clone",
{ "git.checkout", lockfile = opts.lockfile },
"plugin.docs",
@ -108,6 +109,7 @@ function M.update(opts)
opts = M.opts(opts, { mode = "update" })
return M.run({
pipeline = {
"plugin.exists",
"git.origin",
"git.branch",
"git.fetch",
@ -147,6 +149,7 @@ function M.check(opts)
opts = opts or {}
return M.run({
pipeline = {
"plugin.exists",
{ "git.origin", check = true },
"git.fetch",
"git.status",

View file

@ -97,4 +97,15 @@ M.docs = {
end,
}
M.exists = {
skip = function(plugin)
return not plugin._.is_local
end,
run = function(self)
if not Util.file_exists(self.plugin.dir) then
self:error("Local plugin does not exist at `" .. self.plugin.dir .. "`")
end
end,
}
return M