Skip to content

Commit ff6df9e

Browse files
committed
Use shell-env to get env variables
1 parent c8e7cb4 commit ff6df9e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/main.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const cp = require("child_process");
2+
const shellEnv = require("shell-env");
23
const { shell } = require("electron");
34
const { AutoLanguageClient } = require("atom-languageclient");
45

@@ -16,9 +17,12 @@ class PythonLanguageClient extends AutoLanguageClient {
1617
getServerName() {
1718
return "pyls";
1819
}
19-
startServerProcess(projectPath) {
20+
21+
async startServerProcess(projectPath) {
22+
const env = await shellEnv();
2023
const childProcess = cp.spawn(atom.config.get("ide-python.pylsPath"), {
21-
cwd: projectPath
24+
cwd: projectPath,
25+
env: env
2226
});
2327
childProcess.on("error", err =>
2428
atom.notifications.addError(

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"atom": ">=1.0.0 <2.0.0"
1818
},
1919
"dependencies": {
20-
"atom-languageclient": "^0.6.1"
20+
"atom-languageclient": "^0.6.1",
21+
"shell-env": "^0.3.0"
2122
},
2223
"enhancedScopes": ["source.python"],
2324
"configSchema": {

0 commit comments

Comments
 (0)