MCPcopy Create free account
hub / github.com/cztomczak/cefpython / run

Function run

tools/automate-git.py:172–199  ·  view source on GitHub ↗

Runs the specified command.

(command_line, working_dir, depot_tools_dir=None, output_file=None)

Source from the content-addressed store, hash-verified

170
171
172def run(command_line, working_dir, depot_tools_dir=None, output_file=None):
173 """ Runs the specified command. """
174 # add depot_tools to the path
175 env = os.environ
176 if not depot_tools_dir is None:
177 env['PATH'] = depot_tools_dir + os.pathsep + env['PATH']
178
179 sys.stdout.write('-------- Running "'+command_line+'" in "'+\
180 working_dir+'"...'+"\n")
181 if not options.dryrun:
182 args = shlex.split(command_line.replace('\\', '\\\\'))
183
184 if not output_file:
185 return subprocess.check_call(
186 args, cwd=working_dir, env=env, shell=(sys.platform == 'win32'))
187 try:
188 msg('Writing %s' % output_file)
189 with open(output_file, "w") as f:
190 return subprocess.check_call(
191 args,
192 cwd=working_dir,
193 env=env,
194 shell=(sys.platform == 'win32'),
195 stderr=subprocess.STDOUT,
196 stdout=f)
197 except subprocess.CalledProcessError:
198 msg('ERROR Run failed. See %s for output.' % output_file)
199 raise
200
201
202def create_directory(path):

Callers 3

apply_deps_patchFunction · 0.85
run_patch_updaterFunction · 0.85
automate-git.pyFile · 0.85

Calls 1

msgFunction · 0.85

Tested by

no test coverage detected