Skip to content

Commit

Permalink
fix-#4057 info: modify the shellcheck errors file in ./bin
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 >/<
4. not sure the /bin/kyuubi line 63 'exit -1' need modify? so the directory bin only have a shellcheck note in /bin/kyuubi
  • Loading branch information
davidyuan1223 committed Jan 13, 2023
1 parent 03fe8a8 commit 86e4e1c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bin/docker-image-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ 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 86e4e1c

Please sign in to comment.