Created
January 16, 2018 09:35
-
-
Save faresd/ff2b757f9c4975931d82429a6d3ecb81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In case of 'unlisted' target, only passing 'publishTarget' as a request header works | |
if [[ ${PUBLISH_TARGET} == 'unlisted' ]]; then | |
HTTP_CODE=$(curl \ | |
-w %{http_code} \ | |
-o api-response.json \ | |
-H "Authorization: Bearer $ACCESS_TOKEN" \ | |
-H "x-goog-api-version: 2" \ | |
-H "Content-Length: 0" \ | |
-H "publishTarget: $PUBLISH_TARGET" \ | |
-X POST \ | |
-v https://www.googleapis.com/chromewebstore/v1.1/items/${EXTENSION_ID}/publish) | |
# For other targets ('default' or 'trustedTesters') we must pass 'target' as request body in json format | |
else | |
HTTP_CODE=$(curl \ | |
-w %{http_code} \ | |
-o api-response.json \ | |
-H "Authorization: Bearer $ACCESS_TOKEN" \ | |
-H "x-goog-api-version: 2" \ | |
-H "Content-Type: application/json" \ | |
-d "{\"target\":\"$PUBLISH_TARGET\"}" \ | |
-X POST \ | |
-v https://www.googleapis.com/chromewebstore/v1.1/items/${EXTENSION_ID}/publish) | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment