1
1
mirror of https://github.com/nmattia/niv.git synced 2024-09-18 19:07:19 +03:00

Remove warnGitHubEnvVars

This commit is contained in:
Nicolas Mattia 2021-01-04 14:48:05 +01:00
parent 94dadba1a3
commit 18b7314c13
3 changed files with 4 additions and 26 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## UNRELEASED
## Changed
* Remove warnings about GITHUB_INSECURE and GITHUB_PATH
## [0.2.19] 2021-01-05
## Added
* There is a new flag `--no-colors` for avoiding colors in the output

View File

@ -24,7 +24,6 @@ import Data.Text.Extended
import Data.Version (showVersion)
import Niv.Cmd
import Niv.Git.Cmd
import Niv.GitHub.API (warnGitHubEnvVars)
import Niv.GitHub.Cmd
import Niv.Local.Cmd
import Niv.Logger
@ -53,7 +52,6 @@ li = liftIO
cli :: IO ()
cli = do
warnGitHubEnvVars
((fsj, colors), nio) <-
execParserPure' Opts.defaultPrefs opts <$> getArgs
>>= Opts.handleParseResult

View File

@ -15,7 +15,6 @@ import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.Text.Extended
import qualified Network.HTTP.Simple as HTTP
import Niv.Logger
import System.Environment (lookupEnv)
import System.Exit (exitFailure)
import System.IO.Unsafe (unsafePerformIO)
@ -135,29 +134,6 @@ For more information on rate-limiting, see
|]
-- Some environment variables may have different meanings (see for instance
-- https://github.com/nmattia/niv/issues/280)
-- For ambiguous ones, we prepend NIV_.
--
warnGitHubEnvVars :: IO ()
warnGitHubEnvVars =
mapM_
warnEnvVar
[ "GITHUB_INSECURE",
"GITHUB_PATH"
]
where
warnEnvVar vn = lookupEnv (T.unpack vn) >>= \case
Nothing -> pure ()
Just {} -> do
twarn $
T.unwords
[ "The environment variable",
vn,
"was renamed to",
"NIV_" <> vn
]
-- | Like lookupEnv "foo" but also looks up "NIV_foo"
lookupEnv' :: String -> IO (Maybe String)
lookupEnv' vn = lookupEnv vn >>= \case