Skip to content

Commit e23c59b

Browse files
committed
fix typing
1 parent 53c03e3 commit e23c59b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

idom/client/manage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ def _npm_run_build(cwd: Path) -> None:
131131

132132
def _run_subprocess(args: List[str], cwd: Path) -> None:
133133
cmd, *args = args
134-
cmd = shutil.which(cmd)
134+
which_cmd = shutil.which(cmd)
135+
if which_cmd is None:
136+
raise RuntimeError(f"Failed to run command - {cmd!r} is not installed.")
135137
try:
136138
subprocess.run(
137139
[cmd] + args,

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ def run(self):
127127
try:
128128
js_dir = os.path.join(root, "client", "app")
129129
for cmd, *args in map(str.split, ["npm install", "npm run build"]):
130-
cmd_args = [shutil.which(cmd)] + args
130+
which_cmd = shutil.which(cmd)
131+
if which_cmd is None:
132+
raise RuntimeError(
133+
f"Failed to run command - {cmd!r} is not installed."
134+
)
135+
cmd_args = [which_cmd] + args
131136
log.info(f"> {list2cmdline(cmd_args)}")
132137
subprocess.check_call(cmd_args, cwd=js_dir)
133138
except Exception:

0 commit comments

Comments
 (0)