8
8
PLUGIN_FILE_NAME = "typescript.py"
9
9
10
10
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" )
11
18
def get_node_path ():
12
- node_path = "node"
13
- if ts_settings .has ("node_path" ):
14
- node_path = ts_settings .get ("node_path" )
15
19
return node_path
16
20
17
21
def check_for_node ():
18
22
node_path = get_node_path ()
19
23
try :
20
- subprocess .call ([node_path , "--help" ])
24
+ subprocess .call ([node_path , "--help" ], startupinfo = startupinfo )
21
25
except Exception , e :
22
26
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" )
23
27
raise e
@@ -41,10 +45,12 @@ def check_plugin_path():
41
45
42
46
# Write the plugin path into the settings file
43
47
ts_settings .set ("plugin_path" , plugin_path )
48
+ sublime .save_settings ("typescript.sublime-settings" )
44
49
45
50
return True
46
51
47
52
def compile_plugin (plugin_path ):
53
+ print "IN COMPILE PLUGIN"
48
54
def plugin_file (f ):
49
55
return path .join (plugin_path , f )
50
56
@@ -53,7 +59,11 @@ def plugin_file(f):
53
59
if not path .exists (bindir ):
54
60
os .makedirs (bindir )
55
61
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 )
57
67
58
68
# Copy needed files to bin directory
59
69
shutil .copyfile (plugin_file ("lib/typescript/bin/typescript.js" ),
0 commit comments