Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Oct 30, 2024
1 parent 962c601 commit 211edd8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ convert_max_unsigned_int_to_bit()

warn_msg()
{
if test "${NO_COLOR:-0}" != 0; then
if test -n "${NO_COLOR-}"; then
printf 1>&2 '%s\n' "WARNING: ${1}"
elif test "${CI:-false}" = 'false'; then
printf 1>&2 '\033[0;33m\r%s\n\033[0m\r \r' "WARNING: ${1}"
Expand Down Expand Up @@ -989,12 +989,17 @@ list_available_shells()

pause_if_needed()
{
# shellcheck disable=SC3028 # In POSIX sh, SHLVL is undefined
# shellcheck disable=SC3028 # Intended: In POSIX sh, SHLVL is undefined
if test "${NO_PAUSE:-0}" = '0' && test "${CI:-false}" = 'false' && test "${TERM_PROGRAM:-unknown}" != 'vscode' && test "${SHLVL:-1}" = '1' && test -t 0 && test -t 1 && test -t 2; then
printf 1>&2 '\n\033[1;32m%s\033[0m' 'Press any key to exit... ' || :
# shellcheck disable=SC3045
IFS='' read 1> /dev/null 2>&1 -r -s -n 1 _ || IFS='' read 1>&2 -r _ || :
if test -n "${NO_COLOR-}"; then
printf 1>&2 '\n%s' 'Press any key to exit... ' || :
else
printf 1>&2 '\n\033[1;32m\r%s' 'Press any key to exit... ' || :
fi
# shellcheck disable=SC3045 # Intended: In POSIX sh, read -s / -n is undefined
IFS='' read 2> /dev/null 1>&2 -r -s -n 1 _ || IFS='' read 1>&2 -r _ || :
printf 1>&2 '\n' || :
test -n "${NO_COLOR-}" || printf 1>&2 '\033[0m\r \r' || :
fi
return "${1}"
}
Expand Down

0 comments on commit 211edd8

Please sign in to comment.