Skip to content

Instantly share code, notes, and snippets.

@notpushkin
Last active July 3, 2020 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notpushkin/7fba4e2035f2c25bb04dfb9fb51a30c5 to your computer and use it in GitHub Desktop.
Save notpushkin/7fba4e2035f2c25bb04dfb9fb51a30c5 to your computer and use it in GitHub Desktop.
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