Skip to content

Commit

Permalink
feat: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
fwx5618177 committed Apr 4, 2024
1 parent cfc0fc0 commit f22b824
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ install_zig() {
awk 'NR==1 { print $2 }' |
tr -d '"'
)
local expected_shasum=$(json_parse "$json_replace" | grep "\[\"$version\",\"${architecture}-${platform}\",\"shasum\"\]" | awk '{print $2}' | tr -d '"')
local source_path="${install_path}/zig-${platform}-${architecture}-${version}.tar.xz"

local expected_shasum
local source_path
expected_shasum=$(json_parse "$json_replace" | grep "\[\"$version\",\"${architecture}-${platform}\",\"shasum\"\]" | awk '{print $2}' | tr -d '"')
source_path="${install_path}/zig-${platform}-${architecture}-${version}.tar.xz"

echo "∗ Downloading and installing Zig..."
curl --fail --progress-bar --location --create-dirs --output "$source_path" "$download_url"

local computed_shasum="$(shasum -a 256 "$source_path" | awk '{print $1}')"
local computed_shasum
computed_shasum="$(shasum -a 256 "$source_path" | awk '{print $1}')"

if [[ $computed_shasum != "$expected_shasum" ]]; then
version=$(json_parse "$json" | grep "\[\"master\",\"version\"\]" | awk '{print $2}' | tr -d '"')
Expand Down
3 changes: 2 additions & 1 deletion bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ sort_versions() {
}

list_all_versions() {
local json_replace=$(echo "$json" | jq '{(.master.version): .master} + del(.master)')
local json_replace
json_replace=$(echo "$json" | jq '{(.master.version): .master} + del(.master)')
json_parse "$json_replace" |
sed 's/^\[\(.*\)\].*$/\1/' |
grep -Eo '[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?' |
Expand Down

0 comments on commit f22b824

Please sign in to comment.