11import sublime_plugin
22import sublime
33import os
4+ from ..libs .global_vars import IS_ST2
45
56
67class TypescriptBuildCommand (sublime_plugin .WindowCommand ):
@@ -9,8 +10,9 @@ def run(self):
910 directory = os .path .dirname (file_name )
1011 if "tsconfig.json" in os .listdir (directory ):
1112 self .window .run_command ("exec" , {
12- "shell_cmd" : "tsc" ,
13- "file_regex" : "^(.+?)\\ ((\\ d+),(\\ d+)\\ ): (.+)$"
13+ "cmd" : "tsc" ,
14+ "file_regex" : "^(.+?)\\ ((\\ d+),(\\ d+)\\ ): (.+)$" ,
15+ "shell" : True
1416 })
1517 else :
1618 sublime .active_window ().show_input_panel (
@@ -23,7 +25,16 @@ def run(self):
2325
2426 def compile_inferred_project (self , params = "" ):
2527 file_name = self .window .active_view ().file_name ()
26- self .window .run_command ("exec" , {
27- "shell_cmd" : "tsc {0} {1}" .format (file_name , params ),
28- "file_regex" : "^(.+?)\\ ((\\ d+),(\\ d+)\\ ): (.+)$"
29- })
28+ if not IS_ST2 :
29+ cmd = "tsc {0} {1}" .format (file_name , params )
30+ self .window .run_command ("exec" , {
31+ "shell_cmd" : cmd ,
32+ "file_regex" : "^(.+?)\\ ((\\ d+),(\\ d+)\\ ): (.+)$"
33+ })
34+ else :
35+ cmd = "tsc {0} {1}" .format (file_name , params )
36+ self .window .run_command ("exec" , {
37+ "cmd" : [cmd ],
38+ "file_regex" : "^(.+?)\\ ((\\ d+),(\\ d+)\\ ): (.+)$" ,
39+ "shell" : True
40+ })
0 commit comments