diff --git a/README.md b/README.md index 12032a2..40e8f1d 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ Utility functions for working with arrays. Functions for validating common use-cases -- **`_binaryExists_`** Check if a binary exists in the PATH +- **`_commandExists_`** Check if a command or binary exists in the PATH - **`_functionExists_`** Tests if a function is available in current scope - **`_isInternetAvailable_`** Checks if Internet connections are possible - **`_isAlpha_`** Validate that a given variable contains only alphabetic characters diff --git a/test/checks.bats b/test/checks.bats index 6882f93..3a4bc50 100755 --- a/test/checks.bats +++ b/test/checks.bats @@ -86,13 +86,13 @@ teardown() { assert_failure } -@test "_binaryExists_: true" { - run _binaryExists_ "vi" +@test "_commandExists_: true" { + run _commandExists_ "vi" assert_success } -@test "_binaryExists_: false" { - run _binaryExists_ "someNonexistantBinary" +@test "_commandExists_: false" { + run _commandExists_ "someNonexistantBinary" assert_failure } diff --git a/utilities/checks.bash b/utilities/checks.bash index 05d0afe..6a77ec6 100644 --- a/utilities/checks.bash +++ b/utilities/checks.bash @@ -1,6 +1,6 @@ # Functions for validating common use-cases -_binaryExists_() { +_commandExists_() { # DESC: # Check if a binary exists in the search PATH # ARGS: @@ -9,7 +9,7 @@ _binaryExists_() { # 0 if true # 1 if false # USAGE: - # (_binaryExists_ ffmpeg ) && [SUCCESS] || [FAILURE] + # (_commandExists_ ffmpeg ) && [SUCCESS] || [FAILURE] [[ $# == 0 ]] && fatal "Missing required argument to ${FUNCNAME[0]}" if ! command -v "$1" >/dev/null 2>&1; then