Improve AlreadyInstalled
This commit is contained in:
parent
c7774450bf
commit
0e64d1f22f
@ -358,13 +358,11 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
runLogger $ logInfo msg
|
runLogger $ logInfo msg
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
|
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"GHC ver " <> prettyVer v <> " already installed, remove it first to reinstall"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"GHC ver " <> prettyVer v <> " already installed, remove it first to reinstall"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
|
|
||||||
VLeft (V (DirNotEmpty fp)) -> do
|
VLeft (V (DirNotEmpty fp)) -> do
|
||||||
@ -427,17 +425,15 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
forM_ (_viPostInstall =<< vi) $ \msg ->
|
forM_ (_viPostInstall =<< vi) $ \msg ->
|
||||||
runLogger $ logInfo msg
|
runLogger $ logInfo msg
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"Cabal ver " <> prettyVer v <> " already installed; if you really want to reinstall it, you may want to run 'ghcup install cabal --force " <> prettyVer v <> "'"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (FileAlreadyExistsError fp)) -> do
|
VLeft (V (FileAlreadyExistsError fp)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $
|
||||||
"File " <> T.pack fp <> " already exists. Use 'ghcup install cabal --isolate " <> T.pack fp <> " --force ..." <> "' if you want to overwrite."
|
"File " <> T.pack fp <> " already exists. Use 'ghcup install cabal --isolate " <> T.pack fp <> " --force ..." <> "' if you want to overwrite."
|
||||||
pure $ ExitFailure 3
|
pure $ ExitFailure 3
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"Cabal ver " <> prettyVer v <> " already installed; if you really want to reinstall it, you may want to run 'ghcup install cabal --force " <> prettyVer v <> "'"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (FileAlreadyExistsError fp)) -> do
|
VLeft (V (FileAlreadyExistsError fp)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $
|
||||||
@ -479,25 +475,15 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
forM_ (_viPostInstall =<< vi) $ \msg ->
|
forM_ (_viPostInstall =<< vi) $ \msg ->
|
||||||
runLogger $ logInfo msg
|
runLogger $ logInfo msg
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"HLS ver "
|
|
||||||
<> prettyVer v
|
|
||||||
<> " already installed; if you really want to reinstall it, you may want to run 'ghcup install hls --force "
|
|
||||||
<> prettyVer v
|
|
||||||
<> "'"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (FileAlreadyExistsError fp)) -> do
|
VLeft (V (FileAlreadyExistsError fp)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $
|
||||||
"File " <> T.pack fp <> " already exists. Use 'ghcup install hls --isolate " <> T.pack fp <> " --force ..." <> "' if you want to overwrite."
|
"File " <> T.pack fp <> " already exists. Use 'ghcup install hls --isolate " <> T.pack fp <> " --force ..." <> "' if you want to overwrite."
|
||||||
pure $ ExitFailure 3
|
pure $ ExitFailure 3
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"HLS ver "
|
|
||||||
<> prettyVer v
|
|
||||||
<> " already installed; if you really want to reinstall it, you may want to run 'ghcup install hls --force "
|
|
||||||
<> prettyVer v
|
|
||||||
<> "'"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (FileAlreadyExistsError fp)) -> do
|
VLeft (V (FileAlreadyExistsError fp)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $
|
||||||
@ -538,17 +524,15 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
forM_ (_viPostInstall =<< vi) $ \msg ->
|
forM_ (_viPostInstall =<< vi) $ \msg ->
|
||||||
runLogger $ logInfo msg
|
runLogger $ logInfo msg
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"Stack ver " <> prettyVer v <> " already installed; if you really want to reinstall it, you may want to run 'ghcup install stack --force " <> prettyVer v <> "'"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (FileAlreadyExistsError fp)) -> do
|
VLeft (V (FileAlreadyExistsError fp)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $
|
||||||
"File " <> T.pack fp <> " already exists. Use 'ghcup install stack --isolate " <> T.pack fp <> " --force ..." <> "' if you want to overwrite."
|
"File " <> T.pack fp <> " already exists. Use 'ghcup install stack --isolate " <> T.pack fp <> " --force ..." <> "' if you want to overwrite."
|
||||||
pure $ ExitFailure 3
|
pure $ ExitFailure 3
|
||||||
VLeft (V (AlreadyInstalled _ v)) -> do
|
VLeft e@(V (AlreadyInstalled _ _)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $ T.pack $ prettyShow e
|
||||||
"Stack ver " <> prettyVer v <> " already installed; if you really want to reinstall it, you may want to run 'ghcup install stack --force " <> prettyVer v <> "'"
|
|
||||||
pure ExitSuccess
|
pure ExitSuccess
|
||||||
VLeft (V (FileAlreadyExistsError fp)) -> do
|
VLeft (V (FileAlreadyExistsError fp)) -> do
|
||||||
runLogger $ logWarn $
|
runLogger $ logWarn $
|
||||||
|
@ -137,7 +137,9 @@ data AlreadyInstalled = AlreadyInstalled Tool Version
|
|||||||
|
|
||||||
instance Pretty AlreadyInstalled where
|
instance Pretty AlreadyInstalled where
|
||||||
pPrint (AlreadyInstalled tool ver') =
|
pPrint (AlreadyInstalled tool ver') =
|
||||||
pPrint tool <+> text "-" <+> pPrint ver' <+> text "is already installed"
|
pPrint tool <+> text "-" <+> pPrint ver' <+> text "is already installed;"
|
||||||
|
<+> text "if you really want to reinstall it, you may want to run 'ghcup install cabal --force" <+> (pPrint ver' <> text "'")
|
||||||
|
|
||||||
|
|
||||||
-- | The Directory is supposed to be empty, but wasn't.
|
-- | The Directory is supposed to be empty, but wasn't.
|
||||||
data DirNotEmpty = DirNotEmpty {path :: FilePath}
|
data DirNotEmpty = DirNotEmpty {path :: FilePath}
|
||||||
|
Loading…
Reference in New Issue
Block a user