Skip to content

Commit

Permalink
feat(c): check the command existence on PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Feb 19, 2024
1 parent af3bcb5 commit 906ec30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ done

readonly keep_eol quiet target_command

if ((${#target_command[@]} > 0)) && ! which "${target_command[0]}" &>/dev/null; then
die "command '${target_command[0]}' not found on PATH"
fi

################################################################################
# biz logic
################################################################################
Expand Down

0 comments on commit 906ec30

Please sign in to comment.