Skip to content

Commit

Permalink
CLI flag for CDN tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick committed Nov 16, 2021
1 parent 5d90dac commit 352536e
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions gulp-tasks/publish-cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,21 @@ async function handleCDNUpload(tagName, gitBranch) {
}

async function publish_cdn() {
// Get all of the tags in the repo.
const tags = await githubHelper.getTags();
const missingTags = await findMissingCDNTags(tags);

if (missingTags.length === 0) {
logHelper.log('No tags missing from CDN.');
let missingTags = [];

// Usage: npx gulp publish_cdn --cdnTag=vX.Y.Z
// See https://github.com/GoogleChrome/workbox/issues/2479
if (global.cliOptions.cdnTag) {
const tags = [{name: global.cliOptions.cdnTag}];
missingTags = await findMissingCDNTags(tags);
} else {
// Get all of the tags in the repo.
const tags = await githubHelper.getTags();
missingTags = await findMissingCDNTags(tags);

if (missingTags.length === 0) {
logHelper.log('No tags missing from CDN.');
}
}

for (const missingTag of missingTags) {
Expand Down

0 comments on commit 352536e

Please sign in to comment.