Skip to content

Instantly share code, notes, and snippets.

@notpushkin notpushkin/ovsx-mirror.sh

Last active Jul 3, 2020
Embed
What would you like to do?
TOKEN="" # get yours at https://open-vsx.org/user-settings/tokens
temp_file="$(mktemp)"
namespace="${1?usage\: $(basename $0) NAMESPACE PACKAGE_NAME}"
package_name="${2?usage\: $(basename $0) NAMESPACE PACKAGE_NAME}"
version="$(curl "https://vscode-marketplace-api.herokuapp.com/${namespace}/${package_name}" | jq -r .Version)"
echo "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${namespace}/vsextensions/${package_name}/${version}/vspackage"
curl --compressed "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${namespace}/vsextensions/${package_name}/${version}/vspackage" > "${temp_file}"
npx ovsx create-namespace -p "${TOKEN}" "${namespace}"
npx ovsx publish -p "${TOKEN}" "${temp_file}"
rm "${temp_file}"
echo "Woo! Your extension is now available at"
echo ""
echo " https://open-vsx.org/extension/${namespace}/${package_name}"
echo ""
echo "Don't forget to let the author now that you have uploaded it."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.