Add .shellcheckrc

This commit is contained in:
Taiki Endo
2022-08-22 21:50:17 +09:00
parent cb1e26fae1
commit 3f4a57923d
2 changed files with 17 additions and 3 deletions

14
.shellcheckrc Normal file
View File

@@ -0,0 +1,14 @@
# ShellCheck configuration
# https://github.com/koalaman/shellcheck/blob/HEAD/shellcheck.1.md#rc-files
# See also:
# https://www.shellcheck.net/wiki/Optional
# https://google.github.io/styleguide/shellguide.html
# https://www.shellcheck.net/wiki/SC2292
# https://google.github.io/styleguide/shellguide.html#s6.3-tests
enable=require-double-brackets
# https://www.shellcheck.net/wiki/SC2250
# https://google.github.io/styleguide/shellguide.html#s5.6-variable-expansion
enable=require-variable-braces

View File

@@ -123,8 +123,8 @@ cargo_binstall() {
# As a result, http will be disabled, and it will also set
# min tls version to be 1.2
case "${version}" in
latest) cargo binstall --force --secure --no-confirm "$tool" ;;
*) cargo binstall --force --secure --no-confirm --version "$version" "$tool" ;;
latest) cargo binstall --force --secure --no-confirm "${tool}" ;;
*) cargo binstall --force --secure --no-confirm --version "${version}" "${tool}" ;;
esac
}
@@ -146,7 +146,7 @@ case "${OSTYPE}" in
cygwin* | msys*) exe=".exe" ;;
esac
cargo_bin="${CARGO_HOME:-"$HOME/.cargo"}/bin"
cargo_bin="${CARGO_HOME:-"${HOME}/.cargo"}/bin"
if [[ ! -d "${cargo_bin}" ]]; then
cargo_bin=/usr/local/bin
fi