Skip to content

Commit b42dc9a

Browse files
U-raph-PC\raphU-raph-PC\raph
authored andcommitted
Fix settings save after plugin compilation
1 parent c7d6864 commit b42dc9a

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

core/install.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@
88
PLUGIN_FILE_NAME = "typescript.py"
99

1010
ts_settings = sublime.load_settings("typescript.sublime-settings")
11+
node_path = "node"
12+
13+
startupinfo = subprocess.STARTUPINFO()
14+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
15+
16+
if ts_settings.has("node_path"):
17+
node_path = ts_settings.get("node_path")
1118
def get_node_path():
12-
node_path = "node"
13-
if ts_settings.has("node_path"):
14-
node_path = ts_settings.get("node_path")
1519
return node_path
1620

1721
def check_for_node():
1822
node_path = get_node_path()
1923
try:
20-
subprocess.call([node_path, "--help"])
24+
subprocess.call([node_path, "--help"], startupinfo = startupinfo)
2125
except Exception, e:
2226
sublime.error_message("The node executable hasn't been found, you might want to set it in your typescript settings by adding the \"node_path\" key")
2327
raise e
@@ -41,10 +45,12 @@ def check_plugin_path():
4145

4246
# Write the plugin path into the settings file
4347
ts_settings.set("plugin_path", plugin_path)
48+
sublime.save_settings("typescript.sublime-settings")
4449

4550
return True
4651

4752
def compile_plugin(plugin_path):
53+
print "IN COMPILE PLUGIN"
4854
def plugin_file(f):
4955
return path.join(plugin_path, f)
5056

@@ -53,7 +59,11 @@ def plugin_file(f):
5359
if not path.exists(bindir):
5460
os.makedirs(bindir)
5561

56-
subprocess.call([get_node_path(), plugin_file("lib/typescript/bin/tsc.js"), plugin_file("src/ts/main.ts"), "--out", plugin_file("bin/main.js")])
62+
subprocess.call([get_node_path(),
63+
plugin_file("lib/typescript/bin/tsc.js"),
64+
plugin_file("src/ts/main.ts"),
65+
"--out", plugin_file("bin/main.js")],
66+
startupinfo = startupinfo)
5767

5868
# Copy needed files to bin directory
5969
shutil.copyfile(plugin_file("lib/typescript/bin/typescript.js"),

0 commit comments

Comments
 (0)