Support yq (#2036)

Co-authored-by: Taiki Endo <te316e89@gmail.com>
This commit is contained in:
FirelightFlagboy
2026-11-02 04:54:42 +09:00
committed by GitHub
co-authored by Taiki Endo
parent eacbab5a1f
commit cb869a6319
4 changed files with 101 additions and 3 deletions
+4 -3
View File
@@ -96,7 +96,7 @@ download_and_extract() {
# xbuild's binary name is "x", as opposed to the usual crate name
xbuild) installed_bin=("${bin_dir}/x${exe}") ;;
# Their binary names are renamed below.
editorconfig-checker | oxfmt) installed_bin=("${bin_dir}/${tool}${exe}") ;;
editorconfig-checker | oxfmt | yq) installed_bin=("${bin_dir}/${tool}${exe}") ;;
*)
for tmp in "${bin_in_archive[@]}"; do
installed_bin+=("${bin_dir}/$(basename -- "${tmp}")")
@@ -205,7 +205,7 @@ download_and_extract() {
esac
for tmp in "${bin_in_archive[@]}"; do
case "${tool}" in
editorconfig-checker | oxfmt) mv -- "${tmp}" "${bin_dir}/${tool}${exe}" ;;
editorconfig-checker | oxfmt | yq) mv -- "${tmp}" "${bin_dir}/${tool}${exe}" ;;
*) mv -- "${tmp}" "${bin_dir}/" ;;
esac
done
@@ -215,7 +215,7 @@ download_and_extract() {
unzip -q tmp
for tmp in "${bin_in_archive[@]}"; do
case "${tool}" in
editorconfig-checker | oxfmt) mv -- "${tmp}" "${bin_dir}/${tool}${exe}" ;;
editorconfig-checker | oxfmt | yq) mv -- "${tmp}" "${bin_dir}/${tool}${exe}" ;;
*) mv -- "${tmp}" "${bin_dir}/" ;;
esac
done
@@ -371,6 +371,7 @@ download_from_manifest() {
download_from_download_info "$@"
}
download_from_download_info() {
local tool="$1"
read_download_info "$@"
download_and_extract "${url}" "${checksum}" "${bin_dir}" "${bin_in_archive[@]}"
}