Merge pull request #12393 from Bo98/shellcheck-fix
Fix shellcheck `brew style` errors
This commit is contained in:
commit
aaea979a42
@ -657,7 +657,7 @@ EOS
|
|||||||
|
|
||||||
if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]]
|
if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]]
|
||||||
then
|
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}"
|
echo "${TAP} does not exist! Run \`brew untap ${TAP}\` to remove it." >>"${update_failed_file}"
|
||||||
else
|
else
|
||||||
echo "Fetching ${DIR} failed!" >>"${update_failed_file}"
|
echo "Fetching ${DIR} failed!" >>"${update_failed_file}"
|
||||||
|
@ -105,7 +105,7 @@ __brew_complete_tapped() {
|
|||||||
for dir in "${taplib}"/*/*
|
for dir in "${taplib}"/*/*
|
||||||
do
|
do
|
||||||
[[ -d "${dir}" ]] || continue
|
[[ -d "${dir}" ]] || continue
|
||||||
dir="${dir#${taplib}/}"
|
dir="${dir#"${taplib}"/}"
|
||||||
dir="${dir/homebrew-/}"
|
dir="${dir/homebrew-/}"
|
||||||
taps="${taps} ${dir}"
|
taps="${taps} ${dir}"
|
||||||
done
|
done
|
||||||
|
@ -167,7 +167,16 @@ module Homebrew
|
|||||||
def run_shellcheck(files, output_type)
|
def run_shellcheck(files, output_type)
|
||||||
files = shell_scripts if files.blank?
|
files = shell_scripts if files.blank?
|
||||||
|
|
||||||
args = ["--shell=bash", "--enable=all", "--external-sources", "--source-path=#{HOMEBREW_LIBRARY}", "--", *files]
|
args = [
|
||||||
|
"--shell=bash",
|
||||||
|
"--enable=all",
|
||||||
|
"--external-sources",
|
||||||
|
"--source-path=#{HOMEBREW_LIBRARY}",
|
||||||
|
# TODO: fix these
|
||||||
|
"--exclude=SC2310,SC2311,SC2312",
|
||||||
|
"--",
|
||||||
|
*files,
|
||||||
|
]
|
||||||
|
|
||||||
case output_type
|
case output_type
|
||||||
when :print
|
when :print
|
||||||
|
1
bin/brew
1
bin/brew
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Fail fast with concise message when not using bash
|
# Fail fast with concise message when not using bash
|
||||||
# Single brackets is needed here for POSIX compatibility
|
# Single brackets is needed here for POSIX compatibility
|
||||||
|
# shellcheck disable=SC2292
|
||||||
if [ -z "${BASH_VERSION:-}" ]
|
if [ -z "${BASH_VERSION:-}" ]
|
||||||
then
|
then
|
||||||
echo "Error: Bash is required to run brew." >&2
|
echo "Error: Bash is required to run brew." >&2
|
||||||
|
@ -92,7 +92,7 @@ __brew_complete_tapped() {
|
|||||||
for dir in "${taplib}"/*/*
|
for dir in "${taplib}"/*/*
|
||||||
do
|
do
|
||||||
[[ -d "${dir}" ]] || continue
|
[[ -d "${dir}" ]] || continue
|
||||||
dir="${dir#${taplib}/}"
|
dir="${dir#"${taplib}"/}"
|
||||||
dir="${dir/homebrew-/}"
|
dir="${dir/homebrew-/}"
|
||||||
taps="${taps} ${dir}"
|
taps="${taps} ${dir}"
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user