Fix broken command parameter

This commit is contained in:
Lee Dohm
2016-03-08 16:23:48 -08:00
committed by Joe Fitzgerald
parent a3ba15c8a1
commit b98388fa76
3 changed files with 5 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
child_process = require('child_process')
{getShellEnv} = require("../src/environment")
describe "Environment handling", ->
fdescribe "Environment handling", ->
describe "when things are configured properly", ->
beforeEach ->
spyOn(child_process, "spawnSync").andReturn
@@ -21,7 +21,7 @@ describe "Environment handling", ->
describe "when an error occurs", ->
beforeEach ->
spyOn(child_process, "spawnSync").andReturn
error: new Error
error: new Error("testing when an error occurs")
it "returns undefined", ->
expect(getShellEnv()).toBeUndefined()

View File

@@ -231,7 +231,8 @@ class AtomEnvironment extends Model
checkPortableHomeWritable()
# Patch the `process.env` on startup to fix the problem first documented
# in #4126
# in #4126. Retain the original in case someone needs it.
process._originalEnv = process.env
process.env = @project.getEnv()
attachSaveStateListeners: ->

View File

@@ -12,7 +12,7 @@ getRawShellEnv = ->
# work with csh or tcsh. Given that bash and zsh should cover the
# vast majority of users and it gracefully falls back to prior behavior,
# this should be safe.
results = child_process.spawnSync shell, ["-ilc"], input: "env", encoding: "utf8"
results = child_process.spawnSync(shell, ["-ilc", "env"], encoding: "utf8")
return if results.error?
return unless results.stdout and results.stdout.length > 0