From e511fc3c0ab29055cf054517b72b3564cc73662a Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 16 Mar 2022 23:15:09 +0100 Subject: [PATCH] Fix predictable /tmp dirs so `ghcup gc -t` fires --- app/ghcup/GHCup/OptParse/Run.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/ghcup/GHCup/OptParse/Run.hs b/app/ghcup/GHCup/OptParse/Run.hs index c306395..bf6be83 100644 --- a/app/ghcup/GHCup/OptParse/Run.hs +++ b/app/ghcup/GHCup/OptParse/Run.hs @@ -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 + ) )