From 706fe1ffccc4f47cc82c64cc5c64f5c22cb90d90 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 26 Jul 2021 18:13:20 +0200 Subject: [PATCH] Don't do update checks for all commands --- app/ghcup/Main.hs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/ghcup/Main.hs b/app/ghcup/Main.hs index 4078c62..f32c90a 100644 --- a/app/ghcup/Main.hs +++ b/app/ghcup/Main.hs @@ -1390,9 +1390,18 @@ Report bugs at |] race_ (liftIO $ runLogger $ flip runReaderT dirs $ cleanupTrash) (threadDelay 5000000 >> runLogger ($(logWarn) [i|Killing cleanup thread (exceeded 5s timeout)... please remove leftover files in #{recycleDir} manually|])) - lookupEnv "GHCUP_SKIP_UPDATE_CHECK" >>= \case - Nothing -> runLogger $ flip runReaderT s' $ checkForUpdates - Just _ -> pure () + case optCommand of + Nuke -> pure () + Whereis _ _ -> pure () + DInfo -> pure () + ToolRequirements -> pure () + ChangeLog _ -> pure () +#if defined(BRICK) + Interactive -> pure () +#endif + _ -> lookupEnv "GHCUP_SKIP_UPDATE_CHECK" >>= \case + Nothing -> runLogger $ flip runReaderT s' $ checkForUpdates + Just _ -> pure () -- TODO: always run for windows (siletRunLogger $ flip runReaderT s' $ runE ensureGlobalTools) >>= \case