Skip to content

Commit

Permalink
feat(install): improve 'dev' version search prompt (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Jul 2, 2024
1 parent 2c5d242 commit 7b454ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/rocks/operations/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,11 @@ end
---@param version? string #The version of the rock to use
local function prompt_retry_install_with_dev(arg_list, rock_name, version)
if version ~= "dev" then
local rocks = cache.try_get_rocks()
local prompt = rocks[rock_name] and rock_name .. " only has a 'dev' version. Install anyway? "
or "Could not find " .. rock_name .. ". Search for 'dev' version?"
vim.schedule(function()
local choice =
vim.fn.confirm("Could not find " .. rock_name .. ". Search for 'dev' version?", "y/n", "y", "Question")
local choice = vim.fn.confirm(prompt, "y/n", "y", "Question")
if choice == 1 then
arg_list = vim.iter(arg_list)
:filter(function(arg)
Expand Down

0 comments on commit 7b454ba

Please sign in to comment.