mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-25 10:29:51 +08:00
More informative completion install error messages (#1068)
More informative completion install errors
This commit is contained in:
1 parent
1437a2fad5
commit
c2ad46d60e
1 file changed
+15
-7
@@ -95,13 +95,21 @@ def _generate_completion(
|
|||||||
target_path = completions_dir / shell / target_name
|
target_path = completions_dir / shell / target_name
|
||||||
|
|
||||||
# Generate and write the new completion.
|
# Generate and write the new completion.
|
||||||
new = subprocess.run(
|
try:
|
||||||
args=args,
|
new = subprocess.run(
|
||||||
stdout=subprocess.PIPE,
|
args=args,
|
||||||
stderr=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
encoding="utf8",
|
stderr=subprocess.PIPE,
|
||||||
check=True,
|
encoding="utf8",
|
||||||
).stdout
|
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)
|
target_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
if not target_path.exists():
|
if not target_path.exists():
|
||||||
|
|||||||
Reference in new issue
Block a user