From 80fa7965a42d2c892ddf2b9900be97ce7826efcf Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Tue, 10 Aug 2021 20:11:32 +0530 Subject: [PATCH] Adds new Error type `IsolatedDirNotEmpty` --- lib/GHCup/Errors.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/GHCup/Errors.hs b/lib/GHCup/Errors.hs index fa039d7..30d59e0 100644 --- a/lib/GHCup/Errors.hs +++ b/lib/GHCup/Errors.hs @@ -134,6 +134,14 @@ instance Pretty AlreadyInstalled where pPrint (AlreadyInstalled tool ver') = text [i|#{tool}-#{prettyShow ver'} is already installed|] +-- | The Directory for isolated install already exists and is not empty +-- | This is done to prevent any overwriting +data IsolatedDirNotEmpty = IsolatedDirNotEmpty {path :: FilePath} + +instance Pretty IsolatedDirNotEmpty where + pPrint (IsolatedDirNotEmpty path) = do + text [i| The directory for isolated install already exists and is NOT EMPTY : #{path}|] + -- | The tool is not installed. Some operations rely on a tool -- to be installed (such as setting the current GHC version). data NotInstalled = NotInstalled Tool GHCTargetVersion