MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / RunShellCmd

Function RunShellCmd

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

Source from the content-addressed store, hash-verified

98# Runs a command in a directory and returns its return code.
99# Directory is project root by default, or a relative path from project root
100def RunShellCmd(command, start_dir = PROJECT_SRC_DIR, env=None, verbose=False):
101 # Flush stdout here. Helps when debugging on CI.
102 sys.stdout.flush()
103
104 if start_dir != PROJECT_SRC_DIR:
105 start_dir = RepoRelative(start_dir)
106 cmd_list = command.split(" ")
107
108 # Helps a lot when debugging CI issues
109 if IsGHA():
110 verbose = True
111
112 if verbose:
113 print(f'CICMD({cmd_list}, env={env})')
114 subprocess.check_call(cmd_list, cwd=start_dir, env=env)

Callers

nothing calls this directly

Calls 2

IsGHAFunction · 0.85
RepoRelativeFunction · 0.70

Tested by

no test coverage detected