Made the bootstrapper respect the -s option.

This commit is contained in:
Patrick 2025-07-13 13:37:05 +02:00
parent 9abb3ba39f
commit 911c5cd674

View File

@ -36,10 +36,10 @@ def _main() -> Environment:
spp_repository = config.get('SPP_REPOSITORY', _SPP_DEFAULT_REPOSITORY)
spp_branch = config.get('SPP_BRANCH', _SPP_DEFAULT_BRANCH)
print(f'Using SCons++ root at: {spp_root}')
_printinfo(f'Using SCons++ root at: {spp_root}')
if not spp_root.exists():
print('SCons++ does not yet exist, downloading it.')
_printinfo('SCons++ does not yet exist, downloading it.')
_install_spp()
spp_script = spp_root / 'SConscript'
@ -60,7 +60,7 @@ def _get_default_spp_root() -> Path:
elif os.name == 'nt':
# just use LocalAppData, which should always be set on Windows
return Path(os.environ['LocalAppData'], _SPP_FOLDER_NAME)
print(f'Could not detect SCons++ root directory, falling back to ./{_SPP_FOLDER_NAME}.')
_printinfo(f'Could not detect SCons++ root directory, falling back to ./{_SPP_FOLDER_NAME}.')
return Path(_SPP_FOLDER_NAME)
def _install_spp() -> None:
@ -73,6 +73,10 @@ def _install_spp() -> None:
def _exec_checked(args: Sequence[str], **kwargs) -> None:
subprocess.run(args, stdout=sys.stdout, stderr=sys.stderr, check=True, **kwargs)
if not GetOption('silent'):
_printinfo = print
else:
def _printinfo(*args): ...
def _printerr(*args) -> None:
print(*args, file=sys.stderr)