@@ -89,7 +89,8 @@ def tryFixUp(s):
89
89
return
90
90
91
91
92
- def runCheckedCConvert (checkedc_bin , compile_commands_json , checkedc_include_dir , skip_paths , run_individual = False ):
92
+ def runCheckedCConvert (checkedc_bin , compile_commands_json , checkedc_include_dir , skip_paths ,
93
+ skip_running = False , run_individual = False ):
93
94
global INDIVIDUAL_COMMANDS_FILE
94
95
global TOTAL_COMMANDS_FILE
95
96
runs = 0
@@ -150,6 +151,7 @@ def runCheckedCConvert(checkedc_bin, compile_commands_json, checkedc_include_dir
150
151
compilation_base_dir = os .path .dirname (compilation_base_dir )
151
152
prog_name = checkedc_bin
152
153
f = open (INDIVIDUAL_COMMANDS_FILE , 'w' )
154
+ f .write ("#!/bin/bash\n " )
153
155
for compiler_args , target_directory , src_file in s :
154
156
args = []
155
157
# get the command to change the working directory
@@ -176,11 +178,13 @@ def runCheckedCConvert(checkedc_bin, compile_commands_json, checkedc_include_dir
176
178
f .write ("\n " )
177
179
f .close ()
178
180
logging .debug ("Saved all the individual commands into the file:" + INDIVIDUAL_COMMANDS_FILE )
181
+ os .system ("chmod +x " + INDIVIDUAL_COMMANDS_FILE )
179
182
180
183
vcodewriter = VSCodeJsonWriter ()
181
184
# get path to icconv
182
185
vcodewriter .setClangdPath (os .path .join (os .path .dirname (prog_name ), "icconv" ))
183
186
args = []
187
+ args .append ("#!/bin/bash" )
184
188
args .append (prog_name )
185
189
args .extend (DEFAULT_ARGS )
186
190
args .extend (list (set (total_x_args )))
@@ -195,8 +199,9 @@ def runCheckedCConvert(checkedc_bin, compile_commands_json, checkedc_include_dir
195
199
f = open (TOTAL_COMMANDS_FILE , 'w' )
196
200
f .write (" \\ \n " .join (args ))
197
201
f .close ()
202
+ os .system ("chmod +x " + TOTAL_COMMANDS_FILE )
198
203
# run whole command
199
- if not run_individual :
204
+ if not run_individual and not skip_running :
200
205
logging .info ("Running:" + str (' ' .join (args )))
201
206
subprocess .check_call (' ' .join (args ), shell = True )
202
207
logging .debug ("Saved the total command into the file:" + TOTAL_COMMANDS_FILE )
0 commit comments