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

Function run_command

tools/automate.py:955–974  ·  view source on GitHub ↗

Run command in a given directory with env variables set. On Linux multiple commands on one line with the use of && are not allowed.

(command, working_dir, env=None)

Source from the content-addressed store, hash-verified

953
954
955def run_command(command, working_dir, env=None):
956 """Run command in a given directory with env variables set.
957 On Linux multiple commands on one line with the use of && are not allowed.
958 """
959 if isinstance(command, list):
960 command_str = " ".join(command)
961 else:
962 command_str = command
963 print("[automate.py] Running '"+command_str+"' in '" +
964 working_dir+"'...")
965 if isinstance(command, str):
966 args = shlex.split(command.replace("\\", "\\\\"))
967 else:
968 args = command
969 if not env:
970 env = getenv()
971 # When passing list of args shell cannot be True on eg. Linux, read
972 # notes in build.py
973 shell = (platform.system() == "Windows")
974 return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)
975
976
977def run_git(command_line, working_dir):

Callers 7

build_cef_projectsFunction · 0.85
create_prebuilt_binariesFunction · 0.85
run_gitFunction · 0.85
run_automate_gitFunction · 0.85
run_make_distribFunction · 0.85

Calls 1

getenvFunction · 0.85

Tested by

no test coverage detected