Skip to content

Commit

Permalink
fix(prune): remove pruned rocks from [rocks] section, too
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Dec 11, 2023
1 parent d642114 commit 9857745
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/rocks/operations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,15 @@ operations.prune = function(rock_name)
local user_rocks = get_user_rocks()
local success = operations.remove_recursive(rock_name, progress_handle)
vim.schedule(function()
if not user_rocks.plugins then
if not user_rocks.plugins and not user_rocks.rocks then
return
end
if user_rocks.plugins then
user_rocks.plugins[rock_name] = nil
end
if user_rocks.rocks then
user_rocks.rocks[rock_name] = nil
end
fs.write_file(config.config_path, "w", tostring(user_rocks))
if success then
progress_handle:finish()
Expand Down

0 comments on commit 9857745

Please sign in to comment.