Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('publish-extension:chrome', ['package'], () => {
const extensionID = process.env.WEBSTORE_EXTENSION_ID
const webStore = ChromeStore({
extensionId: extensionID,
clientId: process.env.WEBSTORE_CLIENT_ID,
clientSecret: process.env.WEBSTORE_CLIENT_SECRET,
refreshToken: process.env.WEBSTORE_REFRESH_TOKEN,
})
const tokenP = webStore.fetchToken()
const uploadP = tokenP.then(token =>
webStore.uploadExisting(
fs.createReadStream('dist/extension.zip'),
token,
),
)
return Promise.all([tokenP, uploadP]).then(([token]) =>
webStore.publish('default', token),
)