Fix GHCUP_INSTALL_BASE_PREFIX

This should be the *parent* dir of '.ghcup', not
the full destination.
This commit is contained in:
Julian Ospald 2020-04-15 12:53:58 +02:00
parent b18aafe2c4
commit ad4d185ead
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -39,11 +39,10 @@ import qualified System.Posix.User as PU
ghcupBaseDir :: IO (Path Abs) ghcupBaseDir :: IO (Path Abs)
ghcupBaseDir = do ghcupBaseDir = do
getEnv "GHCUP_INSTALL_BASE_PREFIX" >>= \case bdir <- getEnv "GHCUP_INSTALL_BASE_PREFIX" >>= \case
Just r -> parseAbs r Just r -> parseAbs r
Nothing -> do Nothing -> liftIO getHomeDirectory
home <- liftIO getHomeDirectory pure (bdir </> [rel|.ghcup|])
pure (home </> [rel|.ghcup|])
ghcupGHCBaseDir :: IO (Path Abs) ghcupGHCBaseDir :: IO (Path Abs)
ghcupGHCBaseDir = ghcupBaseDir <&> (</> [rel|ghc|]) ghcupGHCBaseDir = ghcupBaseDir <&> (</> [rel|ghc|])