4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-10 18:17:31 +08:00

More informative completion install error messages (#1068)

More informative completion install errors
This commit is contained in:
Brent Yi 2022-12-01 07:36:41 -08:00 committed by GitHub
parent 1437a2fad5
commit c2ad46d60e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,13 +95,21 @@ def _generate_completion(
target_path = completions_dir / shell / target_name
# Generate and write the new completion.
new = subprocess.run(
args=args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
encoding="utf8",
check=True,
).stdout
try:
new = subprocess.run(
args=args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
encoding="utf8",
check=True,
).stdout
except subprocess.CalledProcessError as e:
CONSOLE.log(f":x: Completion script generation failed: {args}")
if e.stdout is not None and len(e.stdout) > 0:
CONSOLE.log(e.stdout)
if e.stderr is not None and len(e.stderr) > 0:
CONSOLE.log(e.stderr)
raise e
target_path.parent.mkdir(parents=True, exist_ok=True)
if not target_path.exists():