Skip to content

Commit

Permalink
feat: show "Run ':Rocks log' for details" tip when error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 6, 2024
1 parent 71446ce commit f345607
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/rocks/operations/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ operations.sync = function(user_rocks, on_complete)
end

if not vim.tbl_isempty(error_handles) then
local message = "Sync completed with errors!"
local message = "Sync completed with errors! Run ':Rocks log' for details."
log.error(message)
progress_handle:report({
title = "Error",
Expand Down Expand Up @@ -460,7 +460,7 @@ operations.update = function(on_complete)
end
nio.scheduler()
if not vim.tbl_isempty(error_handles) then
local message = "Update completed with errors!"
local message = "Update completed with errors! Run ':Rocks log' for details."
log.error(message)
progress_handle:report({
title = "Error",
Expand Down Expand Up @@ -573,12 +573,12 @@ operations.add = function(arg_list, callback)
local stderr = installed_rock
---@cast stderr string
local not_found = stderr:match("No results matching query were found") ~= nil
local message = ("Installation of %s failed"):format(rock_name)
local message = ("Installation of %s failed. Run ':Rocks log' for details."):format(rock_name)
if not_found then
message = ("Could not find %s %s"):format(rock_name, version or "")
end
progress_handle:report({
title = "Error",
title = "Installation failed",
message = message,
})
if not_found then
Expand Down Expand Up @@ -671,7 +671,7 @@ operations.prune = function(rock_name)
if success then
progress_handle:finish()
else
local message = "Prune completed with errors!"
local message = "Prune completed with errors! Run ':Rocks log' for details."
log.error(message)
progress_handle:report({
title = "Error",
Expand Down

0 comments on commit f345607

Please sign in to comment.