From cf7def0c68903814c6b4e04a55fe8f3cb3f5605e Mon Sep 17 00:00:00 2001 From: XuehaiPan Date: Sun, 7 Nov 2021 21:21:42 +0800 Subject: [PATCH] style: apply shellcheck autofix --- Library/Homebrew/cmd/update.sh | 2 +- Library/Homebrew/completions/bash.erb | 2 +- bin/brew | 1 + completions/bash/brew | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 0f9b6355f4..8dd610a604 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -657,7 +657,7 @@ EOS if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]] then - TAP="${DIR#${HOMEBREW_LIBRARY}/Taps/}" + TAP="${DIR#"${HOMEBREW_LIBRARY}"/Taps/}" echo "${TAP} does not exist! Run \`brew untap ${TAP}\` to remove it." >>"${update_failed_file}" else echo "Fetching ${DIR} failed!" >>"${update_failed_file}" diff --git a/Library/Homebrew/completions/bash.erb b/Library/Homebrew/completions/bash.erb index 71a72e6624..b9f52a2cd9 100644 --- a/Library/Homebrew/completions/bash.erb +++ b/Library/Homebrew/completions/bash.erb @@ -105,7 +105,7 @@ __brew_complete_tapped() { for dir in "${taplib}"/*/* do [[ -d "${dir}" ]] || continue - dir="${dir#${taplib}/}" + dir="${dir#"${taplib}"/}" dir="${dir/homebrew-/}" taps="${taps} ${dir}" done diff --git a/bin/brew b/bin/brew index ac635ce4f4..1c8fe3c6e3 100755 --- a/bin/brew +++ b/bin/brew @@ -2,6 +2,7 @@ # Fail fast with concise message when not using bash # Single brackets is needed here for POSIX compatibility +# shellcheck disable=SC2292 if [ -z "${BASH_VERSION:-}" ] then echo "Error: Bash is required to run brew." >&2 diff --git a/completions/bash/brew b/completions/bash/brew index 55b139d0ac..561175ff3e 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -92,7 +92,7 @@ __brew_complete_tapped() { for dir in "${taplib}"/*/* do [[ -d "${dir}" ]] || continue - dir="${dir#${taplib}/}" + dir="${dir#"${taplib}"/}" dir="${dir/homebrew-/}" taps="${taps} ${dir}" done