Merge pull request #15 from toddbluhm/fix-add-system-envs

Add system env vars back into the env list
This commit is contained in:
Todd Bluhm 2016-12-06 21:38:27 -08:00 committed by GitHub
commit 1f02ee0640

View File

@ -10,7 +10,10 @@ function EnvCmd (args) {
const parsedArgs = ParseArgs(args)
// If a .rc file was found then use that
const env = fs.existsSync(rcFileLocation) ? UseRCFile(parsedArgs) : UseCmdLine(parsedArgs)
let env = fs.existsSync(rcFileLocation) ? UseRCFile(parsedArgs) : UseCmdLine(parsedArgs)
// Add in the system environment variables to our environment list
env = Object.assign({}, process.env, env)
// Execute the command with the given environment variables
const proc = spawn(parsedArgs.command, parsedArgs.commandArgs, {
@ -138,7 +141,7 @@ function UseCmdLine (parsedArgs) {
// Parse the env file string using the correct parser
const env = ext === '.json' || ext === '.js'
? Object.assign({}, process.env, require(envFilePath))
? require(envFilePath)
: ParseEnvString(file)
return env