Skip to content

Commit

Permalink
Support detecting stdout, Fix #58 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu authored Jul 28, 2023
1 parent c12a38b commit 8b43040
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions has
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ readonly BINARY_NAME="has"
readonly VERSION="v1.6.0"

## constants - symbols for success failure
if [[ -z $TERM ]]; then
if [[ ! -t 1 ]]; then
TERM="dumb"
elif [[ -z $TERM ]]; then
TERM="xterm"
fi
readonly txtreset="$(tput -T $TERM sgr0)"

Check warning on line 18 in has

View workflow job for this annotation

GitHub Actions / shellcheck

Declare and assign separately to avoid masking return values.
Expand Down Expand Up @@ -153,7 +155,7 @@ __detect(){
gunzip) __dynamic_detect--version "${command}" ;;
tee) __dynamic_detect--version "${command}" ;;
screen) __dynamic_detect-v "${command}" ;;

# Container runtimes
docker|podman) __dynamic_detect--version "${command}" ;;

Expand All @@ -177,7 +179,7 @@ __detect(){
npm|yarn) __dynamic_detect--version "${command}" ;;

## Rust
rustc|cargo) __dynamic_detect--version "${command}" ;;
rustc|cargo) __dynamic_detect--version "${command}" ;;

## Cloud Tools
aws|eb|sls|gcloud) __dynamic_detect--version "${command}" ;;
Expand Down

0 comments on commit 8b43040

Please sign in to comment.