From 00ebd8581ff3cdb1ac547d3a97cda3cb3a0aa012 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 0f9b6355f..8dd610a60 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 71a72e662..b9f52a2cd 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 ac635ce4f..1c8fe3c6e 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 55b139d0a..561175ff3 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