| def error(msg: str) -> None: |
| print('\033[31m' + msg + '\033[0m') |
| if __name__ == '__main__': |
| git_toplevel = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], |
| stderr=subprocess.DEVNULL).decode("ascii").strip() |
| if not pathlib.Path(git_toplevel).resolve() == pathlib.Path('.').resolve(): |
| error('Please run this script from the root folder ({})'.format(git_toplevel)) |
| file = 'include/renderdoc_app.h' |
| url = 'https://raw.githubusercontent.com/baldurk/renderdoc/v1.1/renderdoc/api/app/renderdoc_app.h' |
| print('Syncing {}...'.format(file), end=' ', flush=True) |
| error('Failed to retrieve file: {} {}'.format(req.status_code, req.reason)) |
| with open(file, 'wb') as f: |