Skip to content
Snippets Groups Projects
Unverified Commit b639bfaf authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Merge pull request #9278 from haskell/t9277/fix-warnOnTwoConfigs-on-Windows

Fix overzealous warnOnTwoConfigs
parents bf6653e1 41d7946d
No related branches found
No related tags found
No related merge requests found
Pipeline #84496 failed
......@@ -731,17 +731,19 @@ initialSavedConfig = do
warnOnTwoConfigs :: Verbosity -> IO ()
warnOnTwoConfigs verbosity = do
defaultDir <- getAppUserDataDirectory "cabal"
dotCabalExists <- doesDirectoryExist defaultDir
xdgCfg <- getXdgDirectory XdgConfig ("cabal" </> "config")
xdgCfgExists <- doesFileExist xdgCfg
when (dotCabalExists && xdgCfgExists) $
warn verbosity $
"Both "
<> defaultDir
<> " and "
<> xdgCfg
<> " exist - ignoring the former.\n"
<> "It is advisable to remove one of them. In that case, we will use the remaining one by default (unless '$CABAL_DIR' is explicitly set)."
xdgCfgDir <- getXdgDirectory XdgConfig "cabal"
when (defaultDir /= xdgCfgDir) $ do
dotCabalExists <- doesDirectoryExist defaultDir
let xdgCfg = xdgCfgDir </> "config"
xdgCfgExists <- doesFileExist xdgCfg
when (dotCabalExists && xdgCfgExists) $
warn verbosity $
"Both "
<> defaultDir
<> " and "
<> xdgCfg
<> " exist - ignoring the former.\n"
<> "It is advisable to remove one of them. In that case, we will use the remaining one by default (unless '$CABAL_DIR' is explicitly set)."
-- | If @CABAL\_DIR@ is set, return @Just@ its value. Otherwise, if
-- @~/.cabal@ exists and @$XDG_CONFIG_HOME/cabal/config@ does not
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment