Skip to content

Commit b95243b

Browse files
committed
Simplify template version replace in read_download_info
1 parent 804d0fb commit b95243b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,13 @@ read_download_info() {
277277
bin_in_archive=()
278278
if [[ "${url}" == "null" ]]; then
279279
local template
280-
template=$(jq -r ".template.${host_platform}" "${manifest_dir}/${tool}.json")
280+
template=$(jq -c ".template.${host_platform}" "${manifest_dir}/${tool}.json")
281+
template="${template//\$\{version\}/${exact_version}}"
281282
url=$(jq -r '.url' <<<"${template}")
282-
url="${url//\$\{version\}/${exact_version}}"
283-
tmp=$(jq -r '.bin' <<<"${template}" | sed -E "s/\\$\\{version\\}/${exact_version}/g")
283+
tmp=$(jq -r '.bin' <<<"${template}")
284284
if [[ "${tmp}" == *"["* ]]; then
285285
# shellcheck disable=SC2207
286-
bin_in_archive=($(jq -r '.bin[]' <<<"${template}" | sed -E "s/\\$\\{version\\}/${exact_version}/g"))
286+
bin_in_archive=($(jq -r '.bin[]' <<<"${template}"))
287287
fi
288288
else
289289
tmp=$(jq -r '.bin' <<<"${download_info}")

0 commit comments

Comments
 (0)