feat #14740: fallback update endpoint

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-06 11:41:12 +01:00
co-authored by Claude Opus 5.5
parent 74511d791a
commit bda584deda
4 changed files with 57 additions and 42 deletions
+8 -5
View File
@@ -91,16 +91,19 @@ if [ "${key_of_signature}" != "${key_of_config}" ]; then
fi
# --- Version and update feed ------------------------------------------------
echo "Setting version ${VERSION} and update feed ${UPDATE_JSON_URL}"
# Rewrites a JSON file in place, keeping its permissions.
[ "${#UPDATE_JSON_URLS[@]}" -gt 0 ] || die "UPDATE_JSON_URLS in release.env is empty"
echo "Setting version ${VERSION} and update feeds ${UPDATE_JSON_URLS[*]}"
# Rewrites a JSON file in place (read from stdin, so `--args` can come
# last), keeping its permissions.
jq_in_place() {
local file="$1"
shift
jq "$@" "${file}" >"${WORK_DIR}/edit.json"
jq "$@" <"${file}" >"${WORK_DIR}/edit.json"
cat "${WORK_DIR}/edit.json" >"${file}"
}
jq_in_place "${CONF}" --arg version "${VERSION}" --arg url "${UPDATE_JSON_URL}" \
'.version = $version | .plugins.updater.endpoints = [$url]'
jq_in_place "${CONF}" --arg version "${VERSION}" \
'.version = $version | .plugins.updater.endpoints = $ARGS.positional' \
--args "${UPDATE_JSON_URLS[@]}"
jq_in_place "${PACKAGE_JSON}" --arg version "${VERSION}" '.version = $version'
# The first `version = …` line is the one of [package].
sed -i -E "0,/^version = \"[^\"]*\"/s//version = \"${VERSION}\"/" "${CARGO_TOML}"