Skip to content

Commit 906ec30

Browse files
committed
feat(c): check the command existence on PATH
1 parent af3bcb5 commit 906ec30

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ done
102102

103103
readonly keep_eol quiet target_command
104104

105+
if ((${#target_command[@]} > 0)) && ! which "${target_command[0]}" &>/dev/null; then
106+
die "command '${target_command[0]}' not found on PATH"
107+
fi
108+
105109
################################################################################
106110
# biz logic
107111
################################################################################

0 commit comments

Comments
 (0)