File tree 1 file changed +6
-1
lines changed
cabal-install/Distribution/Client 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ import Control.Exception ( assert, bracket_ )
108
108
import Control.Monad ( forM , liftM2 , unless , when )
109
109
import Data.Bits ( shiftL , shiftR , xor )
110
110
import Data.Char ( ord )
111
+ import Data.Foldable ( forM_ )
111
112
import Data.IORef ( newIORef , writeIORef , readIORef )
112
113
import Data.List ( delete , foldl' )
113
114
import Data.Maybe ( fromJust )
@@ -176,7 +177,11 @@ updateSandboxConfigFileFlag globalFlags =
176
177
case globalSandboxConfigFile globalFlags of
177
178
Flag _ -> return globalFlags
178
179
NoFlag -> do
179
- f' <- fmap (maybe NoFlag Flag ) . lookupEnv $ " CABAL_SANDBOX_CONFIG"
180
+ fp <- lookupEnv " CABAL_SANDBOX_CONFIG"
181
+ forM_ fp $ \ fp' -> do -- Check for existence if environment variable set
182
+ exists <- doesFileExist fp'
183
+ unless exists $ die $ " Cabal sandbox file in $CABAL_SANDBOX_CONFIG does not exist: " ++ fp'
184
+ let f' = maybe NoFlag Flag fp
180
185
return globalFlags { globalSandboxConfigFile = f' }
181
186
182
187
-- | Return the path to the sandbox config file - either the default or the one
You can’t perform that action at this time.
0 commit comments