Merge pull request #1735 from Glavin001/bugfix/1728

Fixes #1728. Remove Shell-Env from Executable, use Atom's process.env instead
This commit is contained in:
Glavin Wiechert 2017-06-21 21:18:16 -03:00 committed by GitHub
commit 11a385f5db
4 changed files with 13 additions and 10 deletions

View File

@ -1,5 +1,6 @@
# Next
- ...
- Fixes [#1728](https://github.com/Glavin001/atom-beautify/issues/1728). Remove Shell-Env from Executable, use Atom's process.env instead. See [#1735](https://github.com/Glavin001/atom-beautify/pull/1735).
# v0.30.2 (2017-06-20)
- Fixes [#1030](https://github.com/Glavin001/atom-beautify/issues/1030). Add support for alpha versions of autopep8

View File

@ -193,6 +193,9 @@
"winston": "2.3.1",
"yaml-front-matter": "3.4.0"
},
"activationHooks": [
"core:loaded-shell-environment"
],
"activationCommands": {
"atom-workspace": [
"atom-beautify:help-debug-editor",
@ -433,4 +436,4 @@
"prettydiff"
]
}
}
}

View File

@ -4,6 +4,10 @@ beautifier = new Beautifiers()
fs = require "fs"
path = require "path"
JsDiff = require('diff')
shellEnv = require('shell-env')
# Fix https://discuss.atom.io/t/specs-do-not-load-shell-environment-variables-activationhooks-core-loaded-shell-environment/44199
process.env = shellEnv.sync()
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#

View File

@ -4,7 +4,6 @@ which = require('which')
spawn = require('child_process').spawn
path = require('path')
semver = require('semver')
shellEnv = require('shell-env')
os = require('os')
fs = require('fs')
@ -324,15 +323,11 @@ class Executable
@_envCache = null
shellEnv: () ->
@constructor.shellEnv()
env = @constructor.shellEnv()
@debug("env", env)
return env
@shellEnv: () ->
if @_envCache
return Promise.resolve(@_envCache)
else
shellEnv()
.then((env) =>
@_envCache = env
)
Promise.resolve(process.env)
###
Like the unix which utility.