Skip to content

Commit 635b6ba

Browse files
authored
adding back in cwd, not sure why it was missing (causing OSX to fail) (#167)
adding back in cwd, previous commit overwrote it
1 parent d6282a1 commit 635b6ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SyntaxCheckPlugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def run_cargo(self, args, cwd):
8989
"""Args should be an array of arguments for cargo.
9090
Returns list of dictionaries of the parsed JSON output.
9191
"""
92+
9293
# When sublime is launched from the dock in OSX, it does not have the user's environment set. So the $PATH env is reset.
9394
# This means ~./cargo/bin won't be added (causing rustup to fail), we can manually add it back in here. [This is a hack, hopefully Sublime fixes this natively]
9495
# fixes https://github.com/rust-lang/sublime-rust/issues/126
@@ -100,7 +101,7 @@ def run_cargo(self, args, cwd):
100101
print('Running %r' % cmd)
101102
# shell=True is needed to stop the window popping up, although it looks like this is needed:
102103
# http://stackoverflow.com/questions/3390762/how-do-i-eliminate-windows-consoles-from-spawned-processes-in-python-2-7
103-
cproc = subprocess.Popen(cmd,
104+
cproc = subprocess.Popen(cmd, cwd=cwd,
104105
shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=env)
105106

106107
output = cproc.communicate()
@@ -133,7 +134,7 @@ def get_rustc_messages(self, settings, file_name):
133134
if settings.get('rust_syntax_checking_include_tests', True):
134135
if not ('--test' in target_args or '--bench' in target_args):
135136
args.append('--test')
136-
yield (target_src, self.run_cargo(args))
137+
yield (target_src, self.run_cargo(args, cwd))
137138

138139
def determine_targets(self, settings, file_name):
139140
"""Detect the target/filters needed to pass to Cargo to compile

0 commit comments

Comments
 (0)