fix(rocks): try building anyway even when prerequisits have not been met. (will likely fail)

This commit is contained in:
Folke Lemaitre 2024-07-08 07:45:43 +02:00
parent 0002bfbd9f
commit f0324defdd
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 41 additions and 27 deletions

View file

@ -21,16 +21,23 @@ M.clean = {
skip = function(plugin)
return plugin._.is_local
end,
run = function(self)
---@param opts? {rocks_only?:boolean}
run = function(self, opts)
opts = opts or {}
local dir = self.plugin.dir:gsub("/+$", "")
assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!")
rm(dir)
local rock_root = Config.options.rocks.root .. "/" .. self.plugin.name
if vim.uv.fs_stat(rock_root) then
rm(rock_root)
end
if opts.rocks_only then
return
end
rm(dir)
self.plugin._.installed = false
end,
}