MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / RunShellCmd

Function RunShellCmd

scripts/common_codegen.py:44–58  ·  view source on GitHub ↗
(command, start_dir = PROJECT_SRC_DIR, env=None, verbose=False)

Source from the content-addressed store, hash-verified

42# Runs a command in a directory and returns its return code.
43# Directory is project root by default, or a relative path from project root
44def RunShellCmd(command, start_dir = PROJECT_SRC_DIR, env=None, verbose=False):
45 # Flush stdout here. Helps when debugging on CI.
46 sys.stdout.flush()
47
48 if start_dir != PROJECT_SRC_DIR:
49 start_dir = repo_relative(start_dir)
50 cmd_list = command.split(" ")
51
52 # Helps a lot when debugging CI issues
53 if IsGHA():
54 verbose = True
55
56 if verbose:
57 print(f'CICMD({cmd_list}, env={env})')
58 subprocess.check_call(cmd_list, cwd=start_dir, env=env)

Callers

nothing calls this directly

Calls 2

IsGHAFunction · 0.85
repo_relativeFunction · 0.70

Tested by

no test coverage detected