Skip to content

Commit 95514c6

Browse files
WichoGZFmanateelazycat
authored andcommitted
Raise exception when command not found and ensure_pass is True
1 parent bb00de5 commit 95514c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

install-eaf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def run_command(command, path=script_path, ensure_pass=True, get_result=False):
7777

7878
# Throw exception if command not found,
7979
# We found install-eaf.py still can work even it not found npm in system.
80-
if not which(command[0]):
81-
return Exception(f"Not found command: {command[0]}")
80+
if (not which(command[0])) and ensure_pass:
81+
raise Exception(f"Not found command: {command[0]}")
8282

8383
# Use LC_ALL=C to make sure command output use English.
8484
# Then we can use English keyword to check command output.

0 commit comments

Comments
 (0)