mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-10 14:40:32 +00:00
Simplify template version replace in read_download_info
This commit is contained in:
8
main.sh
8
main.sh
@@ -277,13 +277,13 @@ read_download_info() {
|
|||||||
bin_in_archive=()
|
bin_in_archive=()
|
||||||
if [[ "${url}" == "null" ]]; then
|
if [[ "${url}" == "null" ]]; then
|
||||||
local template
|
local template
|
||||||
template=$(jq -r ".template.${host_platform}" "${manifest_dir}/${tool}.json")
|
template=$(jq -c ".template.${host_platform}" "${manifest_dir}/${tool}.json")
|
||||||
|
template="${template//\$\{version\}/${exact_version}}"
|
||||||
url=$(jq -r '.url' <<<"${template}")
|
url=$(jq -r '.url' <<<"${template}")
|
||||||
url="${url//\$\{version\}/${exact_version}}"
|
tmp=$(jq -r '.bin' <<<"${template}")
|
||||||
tmp=$(jq -r '.bin' <<<"${template}" | sed -E "s/\\$\\{version\\}/${exact_version}/g")
|
|
||||||
if [[ "${tmp}" == *"["* ]]; then
|
if [[ "${tmp}" == *"["* ]]; then
|
||||||
# shellcheck disable=SC2207
|
# shellcheck disable=SC2207
|
||||||
bin_in_archive=($(jq -r '.bin[]' <<<"${template}" | sed -E "s/\\$\\{version\\}/${exact_version}/g"))
|
bin_in_archive=($(jq -r '.bin[]' <<<"${template}"))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
tmp=$(jq -r '.bin' <<<"${download_info}")
|
tmp=$(jq -r '.bin' <<<"${download_info}")
|
||||||
|
|||||||
Reference in New Issue
Block a user