From 08b0ecd0570094c9d10a83e47f1c82ee5cc375c4 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 13 Jun 2021 15:05:39 +0200 Subject: [PATCH] Allow to skip update checks --- README.md | 1 + app/ghcup/Main.hs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75a56f1..1df8b42 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ This is the complete list of env variables that change GHCup behavior: * `GHCUP_INSTALL_BASE_PREFIX`: the base of ghcup (default: `$HOME`) * `GHCUP_CURL_OPTS`: additional options that can be passed to curl * `GHCUP_WGET_OPTS`: additional options that can be passed to wget +* `GHCUP_SKIP_UPDATE_CHECK`: Skip the (possibly annoying) update check when you run a command * `CC`/`LD` etc.: full environment is passed to the build system when compiling GHC via GHCup ### Installing custom bindists diff --git a/app/ghcup/Main.hs b/app/ghcup/Main.hs index cc0327a..2da1b12 100644 --- a/app/ghcup/Main.hs +++ b/app/ghcup/Main.hs @@ -1144,7 +1144,10 @@ Report bugs at |] case optCommand of Upgrade _ _ -> pure () - _ -> runLogger $ flip runReaderT appstate $ checkForUpdates + _ -> do + lookupEnv "GHCUP_SKIP_UPDATE_CHECK" >>= \case + Nothing -> runLogger $ flip runReaderT appstate $ checkForUpdates + Just _ -> pure () -- ensure global tools