vscodium/build/update_api.sh

40 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2022-08-09 09:21:59 -04:00
2022-10-06 16:18:18 -04:00
set -e
2022-09-04 11:39:57 -04:00
export VSCODE_QUALITY="stable"
while getopts ":i" opt; do
2022-09-04 11:39:57 -04:00
case "$opt" in
i)
export VSCODE_QUALITY="insider"
;;
*)
;;
2022-09-04 11:39:57 -04:00
esac
done
URL=$( curl -s "https://update.code.visualstudio.com/api/update/win32-x64-archive/${VSCODE_QUALITY}/0000000000000000000000000000000000000000" | jq -c '.url' | sed -E 's/.*"([^"]+)".*/\1/' )
2022-08-09 09:21:59 -04:00
# echo "url: ${URL}"
FILE="${URL##*/}"
2022-08-09 09:21:59 -04:00
# echo "file: ${FILE}"
DIRECTORY="${FILE%.zip}"
2022-08-09 09:21:59 -04:00
# echo "directory: ${DIRECTORY}"
if [[ ! -f "${FILE}" ]]; then
wget "${URL}"
fi
if [[ ! -d "${DIRECTORY}" ]]; then
unzip "${FILE}" -d "${DIRECTORY}"
fi
APIS=$( jq -r '.extensionEnabledApiProposals' "${DIRECTORY}/resources/app/product.json" )
2022-08-09 09:21:59 -04:00
APIS=$( echo "${APIS}" | jq '. += {"jeanp413.open-remote-ssh": ["resolvers", "tunnels", "terminalDataWriteEvent", "contribRemoteHelp", "contribViewsRemote"]}' )
APIS=$( echo "${APIS}" | jq '. += {"jeanp413.open-remote-wsl": ["resolvers", "contribRemoteHelp", "contribViewsRemote"]}' )
jsonTmp=$( jq --argjson v "${APIS}" 'setpath(["extensionEnabledApiProposals"]; $v)' product.json )
2023-08-03 18:22:50 -04:00
echo "${jsonTmp}" > product.json && unset jsonTmp