Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(install): improve 'dev' version search prompt #446

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading