From 3bbc1edb198505c8b2ea4deb0b30dae7f5fea2a6 Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Tue, 28 Jun 2022 19:49:00 +0530 Subject: [PATCH] updates user prompt message for "set" uninstalled version in BrickMain --- app/ghcup/BrickMain.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/ghcup/BrickMain.hs b/app/ghcup/BrickMain.hs index ed2e652..1c75d1d 100644 --- a/app/ghcup/BrickMain.hs +++ b/app/ghcup/BrickMain.hs @@ -53,6 +53,8 @@ import Text.PrettyPrint.HughesPJClass ( prettyShow ) import URI.ByteString import qualified Data.Text as T +import qualified Data.Text.Lazy.Builder as B +import qualified Data.Text.Lazy as L import qualified Graphics.Vty as Vty import qualified Data.Vector as V import System.Environment (getExecutablePath) @@ -510,13 +512,18 @@ set' bs input@(_, ListResult {..}) = do >>= \case VRight _ -> pure $ Right () VLeft e -> case e of - (V (NotInstalled tool tver)) -> do - promptAnswer <- liftIO $ getUserPromptResponse userPrompt + (V (NotInstalled tool _)) -> do + promptAnswer <- getUserPromptResponse userPrompt case promptAnswer of PromptYes -> install' bs input PromptNo -> pure $ Left (prettyShow e) where - userPrompt = "The tool/version you're trying to set is not installed, would you like to install it first? " + userPrompt = L.toStrict $ + B.toLazyText $ + B.fromString " This Version of " <> + B.fromString (show tool) <> + B.fromString " you are trying to set is not installed.\n" <> + B.fromString " Would you like to install it first? [Y/N]: " _ -> pure $ Left (prettyShow e)