| 33 | # Runs a command in a directory and returns its return code. |
| 34 | # Directory is project root by default, or a relative path from project root |
| 35 | def RunShellCmd(command, start_dir = PROJECT_SRC_DIR, env=None, verbose=False): |
| 36 | # Flush stdout here. Helps when debugging on CI. |
| 37 | sys.stdout.flush() |
| 38 | |
| 39 | if start_dir != PROJECT_SRC_DIR: |
| 40 | start_dir = RepoRelative(start_dir) |
| 41 | cmd_list = command.split(" ") |
| 42 | |
| 43 | if verbose: |
| 44 | print(f'CICMD({cmd_list}, env={env})') |
| 45 | subprocess.check_call(cmd_list, cwd=start_dir, env=env) |
| 46 | |
| 47 | def main(): |
| 48 | configs = ['Release', 'Debug'] |