Skip to content

Commit 7fba16b

Browse files
committed
Update setupbase
1 parent 1888f0d commit 7fba16b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

setupbase.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ def run(cmd, **kwargs):
212212
kwargs.setdefault('shell', os.name == 'nt')
213213
if not isinstance(cmd, (list, tuple)) and os.name != 'nt':
214214
cmd = shlex.split(cmd)
215-
cmd[0] = which(cmd[0])
215+
cmd_path = which(cmd[0])
216+
if not cmd_path:
217+
sys.exit("Aborting. Could not find cmd (%s) in path. "
218+
"If command is not expected to be in user's path, "
219+
"use an absolute path." % cmd[0])
220+
cmd[0] = cmd_path
216221
return subprocess.check_call(cmd, **kwargs)
217222

218223

0 commit comments

Comments
 (0)