Skip to content

Commit b8b5ec9

Browse files
committed
fix(lint): resolve shellcheck SC2312 in check-cross-compiler.sh
Capture get_os() output in a variable before using it in conditionals, preventing the return value from being masked by [[ ]]. Reuse the variable in the later case statement.
1 parent b408180 commit b8b5ec9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

t/scripts/check-cross-compiler.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ install_cross_compiler_macos() {
5757

5858
main() {
5959
# Cross-compiler is only needed on non-Linux systems
60-
if [[ "$(get_os)" == "Linux" ]]; then
60+
local os
61+
os="$(get_os)"
62+
if [[ ${os} == "Linux" ]]; then
6163
exit 0
6264
fi
6365

@@ -85,7 +87,7 @@ main() {
8587
echo ""
8688
err "Please install manually:"
8789

88-
case "$(get_os)" in
90+
case "${os}" in
8991
Darwin)
9092
local formula
9193
formula="$(get_brew_formula)"

0 commit comments

Comments
 (0)