MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / check_closure_compiler

Function check_closure_compiler

tools/building.py:505–522  ·  view source on GitHub ↗
(cmd, args, env, allowed_to_fail)

Source from the content-addressed store, hash-verified

503
504
505def check_closure_compiler(cmd, args, env, allowed_to_fail):
506 cmd = cmd + args + ['--version']
507 try:
508 output = run_process(cmd, stdout=PIPE, env=env).stdout
509 except Exception as e:
510 if allowed_to_fail:
511 return False
512 if isinstance(e, subprocess.CalledProcessError):
513 sys.stderr.write(e.stdout)
514 sys.stderr.write(str(e) + '\n')
515 exit_with_error('closure compiler (%s) did not execute properly!' % shlex.join(cmd))
516
517 if 'Version:' not in output:
518 if allowed_to_fail:
519 return False
520 exit_with_error('unrecognized closure compiler --version output (%s):\n%s' % (shlex.join(cmd), output))
521
522 return True
523
524
525def get_closure_compiler_and_env(user_args):

Callers 1

Calls 4

run_processFunction · 0.85
exit_with_errorFunction · 0.85
writeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected