Fix predictable /tmp dirs so `ghcup gc -t` fires

This commit is contained in:
Julian Ospald 2022-03-16 23:15:09 +01:00
parent 3ff670134c
commit e511fc3c0a
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
1 changed files with 6 additions and 5 deletions

View File

@ -377,11 +377,12 @@ run RunOptions{..} runAppState leanAppstate runLogger = runE @RunEffects ( do
predictableTmpDir Toolchain{..} = do
tmp <- getTemporaryDirectory
pure $ tmp
</> ("ghcup"
<> maybe "" (("_ghc-" <>) . T.unpack . tVerToText) ghcVer
<> maybe "" (("_cabal-" <>) . T.unpack . tVerToText) cabalVer
<> maybe "" (("_hls-" <>) . T.unpack . tVerToText) hlsVer
<> maybe "" (("_stack-" <>) . T.unpack . tVerToText) stackVer
</> ("ghcup-" <> intercalate "_"
( maybe [] ( (:[]) . ("ghc-" <>) . T.unpack . tVerToText) ghcVer
<> maybe [] ( (:[]) . ("cabal-" <>) . T.unpack . tVerToText) cabalVer
<> maybe [] ( (:[]) . ("hls-" <>) . T.unpack . tVerToText) hlsVer
<> maybe [] ( (:[]) . ("stack-" <>) . T.unpack . tVerToText) stackVer
)
)