Fix environment variable overriding in processes (#1028)

This commit is contained in:
Filip Sodić 2023-02-24 14:00:10 +01:00 committed by GitHub
parent 799db73f34
commit 3264b7c66b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,10 @@ runNodeCommandAsJobWithExtraEnv extraEnvVars fromDir command args jobType chan =
runProcessAsJob nodeCommandProcess jobType chan runProcessAsJob nodeCommandProcess jobType chan
else exitWithError (ExitFailure 1) (T.pack $ makeNodeVersionMismatchMessage nodeVersion) else exitWithError (ExitFailure 1) (T.pack $ makeNodeVersionMismatchMessage nodeVersion)
where where
getAllEnvVars = (++ extraEnvVars) <$> getEnvironment -- Haskell will use the first value for variable name it finds. Since env
-- vars in 'extraEnvVars' should override the the inherited env vars, we
-- must prepend them.
getAllEnvVars = (extraEnvVars ++) <$> getEnvironment
exitWithError exitCode errorMsg = do exitWithError exitCode errorMsg = do
writeChan chan $ writeChan chan $
J.JobMessage J.JobMessage