fix the canary version in set-package-version.js

This commit is contained in:
Tom Jenkinson
2020-11-03 18:26:31 +00:00
parent e1288b68e5
commit 694d14b57c
+2 -2
View File
@@ -31,7 +31,7 @@ try {
// if last git tagged version is a prerelease we should append `.0.<type>.<commit num>`
// if the last git tagged version is a stable version then we should append `-0.<type>.<commit num>` and increment the patch
// `type` can be `pr`, `branch`, or `alpha`
// `type` can be `pr`, `branch`, or `canary`
if (isStable) {
intermediateVersion = incrementPatch(intermediateVersion);
}
@@ -43,7 +43,7 @@ try {
? `pr.${process.env.REVIEW_ID/* set by netlify */}.${getCommitHash().substr(0, 8)}`
: process.env.NETLIFY && process.env.CONTEXT === 'branch-deploy'
? `branch.${process.env.BRANCH/* set by netlify */.replace(/[^a-zA-Z0-9]/g, '-')}.${getCommitHash().substr(0, 8)}`
: `0.alpha.${getCommitNum()}`;
: `0.canary.${getCommitNum()}`;
newVersion = `${intermediateVersion}${isStable ? '-' : '.'}${suffix}`;
}