Skip to content

Commit

Permalink
update os.environ before starting the flow server in flow_ide_server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Mar 29, 2018
1 parent 1db3c76 commit 5ae5e3a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libs/flow/flow_ide_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .flow_cli import FlowCLI
from .main import get_flow_path
from ..node import NodeJS
from ..javascript_enhancements_settings import *

flow_ide_clients = {}

Expand Down Expand Up @@ -40,6 +41,14 @@ def start_stdio_server(self, on_receive, on_closed, options = []):
print("starting flow ide server: " + str(args))
sublime.status_message('Starting flow ide server, root: ' + self.root)

old_env = os.environ.copy()

new_env = old_env.copy()
new_env["PATH"] = new_env["PATH"] + javaScriptEnhancements.get("PATH")

# update the PATH environment variable
os.environ.update(new_env)

try:
self.process = subprocess.Popen(
args,
Expand All @@ -59,6 +68,9 @@ def start_stdio_server(self, on_receive, on_closed, options = []):
except Exception as err:
print("Failed to start flow ide server: " + str(args), err)

# reset the PATH environment variable
os.environ.update(old_env)

def send(self, message):
if self.stdio_transport:
self.stdio_transport.send(message)
Expand Down

0 comments on commit 5ae5e3a

Please sign in to comment.