Skip to content

Commit 360ad4a

Browse files
committed
lint: Fix SC2155 violations
1 parent f59dd9c commit 360ad4a

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

share/ruby-install/checksums.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ function lookup_checksum()
3030
return 1
3131
fi
3232

33-
local output="$(grep " $file" "$checksums")"
33+
local output
34+
output="$(grep " $file" "$checksums")"
3435

3536
echo -n "${output%% *}"
3637
}
@@ -55,7 +56,8 @@ function compute_checksum()
5556
fi
5657

5758
debug "$program $file"
58-
local output="$($program "$file")"
59+
local output
60+
output="$($program "$file")"
5961

6062
echo -n "${output%% *}"
6163
}
@@ -71,7 +73,8 @@ function verify_checksum()
7173
return
7274
fi
7375

74-
local actual_checksum="$(compute_checksum "$algorithm" "$file")"
76+
local actual_checksum
77+
actual_checksum="$(compute_checksum "$algorithm" "$file")"
7578

7679
if [[ "$actual_checksum" != "$expected_checksum" ]]; then
7780
error "Invalid $algorithm checksum for $file"

share/ruby-install/package_manager.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function install_packages()
2929
run $sudo pkg install -y "$@" || return $?
3030
;;
3131
brew)
32-
local brew_owner="$(/usr/bin/stat -f %Su "$(command -v brew)")"
32+
local brew_owner=
33+
brew_owner="$(/usr/bin/stat -f %Su "$(command -v brew)")"
3334
local brew_sudo=""
3435

3536
if [[ "$brew_owner" != "$(id -un)" ]]; then

share/ruby-install/ruby-install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ function init()
272272
return 1
273273
fi
274274

275-
local fully_qualified_version="$(lookup_ruby_version "$ruby" "$ruby_version")"
275+
local fully_qualified_version
276+
fully_qualified_version="$(lookup_ruby_version "$ruby" "$ruby_version")"
276277

277278
if [[ -n "$fully_qualified_version" ]]; then
278279
ruby_version="$fully_qualified_version"

0 commit comments

Comments
 (0)