From ad4d185ead8253a3474ce98b8646b4843b1feb5e Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 15 Apr 2020 12:53:58 +0200 Subject: [PATCH] Fix GHCUP_INSTALL_BASE_PREFIX This should be the *parent* dir of '.ghcup', not the full destination. --- lib/GHCup/Utils/Dirs.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/GHCup/Utils/Dirs.hs b/lib/GHCup/Utils/Dirs.hs index 8f7f83b..c559453 100644 --- a/lib/GHCup/Utils/Dirs.hs +++ b/lib/GHCup/Utils/Dirs.hs @@ -39,11 +39,10 @@ import qualified System.Posix.User as PU ghcupBaseDir :: IO (Path Abs) ghcupBaseDir = do - getEnv "GHCUP_INSTALL_BASE_PREFIX" >>= \case + bdir <- getEnv "GHCUP_INSTALL_BASE_PREFIX" >>= \case Just r -> parseAbs r - Nothing -> do - home <- liftIO getHomeDirectory - pure (home [rel|.ghcup|]) + Nothing -> liftIO getHomeDirectory + pure (bdir [rel|.ghcup|]) ghcupGHCBaseDir :: IO (Path Abs) ghcupGHCBaseDir = ghcupBaseDir <&> ( [rel|ghc|])