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:
commit
11a385f5db
|
@ -1,5 +1,6 @@
|
||||||
# Next
|
# 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)
|
# v0.30.2 (2017-06-20)
|
||||||
- Fixes [#1030](https://github.com/Glavin001/atom-beautify/issues/1030). Add support for alpha versions of autopep8
|
- Fixes [#1030](https://github.com/Glavin001/atom-beautify/issues/1030). Add support for alpha versions of autopep8
|
||||||
|
|
|
@ -193,6 +193,9 @@
|
||||||
"winston": "2.3.1",
|
"winston": "2.3.1",
|
||||||
"yaml-front-matter": "3.4.0"
|
"yaml-front-matter": "3.4.0"
|
||||||
},
|
},
|
||||||
|
"activationHooks": [
|
||||||
|
"core:loaded-shell-environment"
|
||||||
|
],
|
||||||
"activationCommands": {
|
"activationCommands": {
|
||||||
"atom-workspace": [
|
"atom-workspace": [
|
||||||
"atom-beautify:help-debug-editor",
|
"atom-beautify:help-debug-editor",
|
||||||
|
|
|
@ -4,6 +4,10 @@ beautifier = new Beautifiers()
|
||||||
fs = require "fs"
|
fs = require "fs"
|
||||||
path = require "path"
|
path = require "path"
|
||||||
JsDiff = require('diff')
|
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.
|
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
|
||||||
#
|
#
|
||||||
|
|
|
@ -4,7 +4,6 @@ which = require('which')
|
||||||
spawn = require('child_process').spawn
|
spawn = require('child_process').spawn
|
||||||
path = require('path')
|
path = require('path')
|
||||||
semver = require('semver')
|
semver = require('semver')
|
||||||
shellEnv = require('shell-env')
|
|
||||||
os = require('os')
|
os = require('os')
|
||||||
fs = require('fs')
|
fs = require('fs')
|
||||||
|
|
||||||
|
@ -324,15 +323,11 @@ class Executable
|
||||||
|
|
||||||
@_envCache = null
|
@_envCache = null
|
||||||
shellEnv: () ->
|
shellEnv: () ->
|
||||||
@constructor.shellEnv()
|
env = @constructor.shellEnv()
|
||||||
|
@debug("env", env)
|
||||||
|
return env
|
||||||
@shellEnv: () ->
|
@shellEnv: () ->
|
||||||
if @_envCache
|
Promise.resolve(process.env)
|
||||||
return Promise.resolve(@_envCache)
|
|
||||||
else
|
|
||||||
shellEnv()
|
|
||||||
.then((env) =>
|
|
||||||
@_envCache = env
|
|
||||||
)
|
|
||||||
|
|
||||||
###
|
###
|
||||||
Like the unix which utility.
|
Like the unix which utility.
|
||||||
|
|
Loading…
Reference in New Issue