We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d4fcd8 commit 23e5c64Copy full SHA for 23e5c64
1 file changed
spin/cmds/util.py
@@ -5,6 +5,7 @@
5
import copy
6
import os
7
import shlex
8
+import shutil
9
import subprocess
10
import sys
11
from collections.abc import Callable
@@ -65,8 +66,15 @@ def run(
65
66
kwargs = {**output_kwargs, **kwargs}
67
68
if replace and (sys.platform in ("linux", "darwin")):
69
+ if not shutil.which(cmd[0]):
70
+ click.secho(
71
+ f"`{cmd[0]}` executable not found; exiting.",
72
+ fg="bright_red",
73
+ )
74
+ raise SystemExit(1) from None
75
+
76
os.execvp(cmd[0], cmd)
- print(f"Failed to launch `{cmd}`")
77
+ print(f"Failed to launch `{cmd}`; exiting.")
78
sys.exit(-1)
79
else:
80
try:
0 commit comments