Behavior Enhancement: make user press "S" only once to set, asks to install AND set if tool uninstalled

This commit is contained in:
Arjun Kathuria 2022-06-28 19:50:22 +05:30
parent 3bbc1edb19
commit 7cbe38b011

View File

@ -515,7 +515,14 @@ set' bs input@(_, ListResult {..}) = do
(V (NotInstalled tool _)) -> do
promptAnswer <- getUserPromptResponse userPrompt
case promptAnswer of
PromptYes -> install' bs input
PromptYes -> do
res <- install' bs input
case res of
(Left err) -> pure $ Left (prettyShow err)
(Right _) -> do
logInfo "Setting now..."
set' bs input
PromptNo -> pure $ Left (prettyShow e)
where
userPrompt = L.toStrict $