Skip to content

Commit

Permalink
fix-#4057 info:
Browse files Browse the repository at this point in the history
1. "$@" is a array, we want use string to compare. so update "$@" => "$*"
2. `tty` mean execute the command, we can use $(tty) replace it
3. param $# is a number, compare number should use -gt/-lt,not >/<
  • Loading branch information
davidyuan1223 committed Jan 13, 2023
1 parent 03fe8a8 commit dd39efd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions bin/docker-image-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ Examples:
EOF
}

# shellcheck disable=SC2199
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
if [[ "$*" = *--help ]] || [[ "$*" = *-h ]]; then
usage
exit 0
fi
Expand Down
4 changes: 2 additions & 2 deletions bin/kyuubi
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function usage() {
echo " -h | --help - Show this help message"
}

# shellcheck disable=SC2199
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then

if [[ "$*" = *--help ]] || [[ "$*" = *-h ]]; then
usage
exit 0
fi
Expand Down
8 changes: 4 additions & 4 deletions bin/kyuubi-logo
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

# Bugzilla 37848: When no TTY is available, don't output to console
have_tty=0
# shellcheck disable=SC2006
if [[ "`tty`" != "not a tty" ]]; then

if [[ "$(tty)" != "not a tty" ]]; then
have_tty=1
fi

# Bugzilla 37848: When no TTY is available, don't output to console
have_tty=0
# shellcheck disable=SC2006
if [[ "`tty`" != "not a tty" ]]; then

if [[ "$(tty)" != "not a tty" ]]; then
have_tty=1
fi

Expand Down
4 changes: 2 additions & 2 deletions bin/stop-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# limitations under the License.
#

# shellcheck disable=SC2071
if [[ $# < 1 ]] ; then

if [[ $# -lt 1 ]] ; then
echo "USAGE: $0 <application_id>"
exit 1
fi
Expand Down

0 comments on commit dd39efd

Please sign in to comment.