Skip to content

Commit

Permalink
fix config for beta switch
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed May 12, 2021
1 parent 2f59eaa commit f16b858
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@
const path = require('path');
const versions = require('./versions.json');

// This probably only makes sense for the alpha phase, temporary
function getNextAlphaVersionName() {
const expectedPrefix = '2.0.0-alpha.';
// This probably only makes sense for the beta phase, temporary
function getNextBetaVersionName() {
const expectedPrefix = '2.0.0-beta.';

const lastReleasedVersion = versions[0];
if (!lastReleasedVersion.includes(expectedPrefix)) {
throw new Error(
'this code is only meant to be used during the 2.0 alpha phase.',
'this code is only meant to be used during the 2.0 beta phase.',
);
}
const alphaBuild = parseInt(
lastReleasedVersion.replace(expectedPrefix, ''),
10,
);
return `${expectedPrefix}${alphaBuild + 1}`;
const version = parseInt(lastReleasedVersion.replace(expectedPrefix, ''), 10);
return `${expectedPrefix}${version + 1}`;
}

const allDocHomesPaths = [
Expand Down Expand Up @@ -240,7 +237,7 @@ const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
: undefined,
versions: {
current: {
label: `${getNextAlphaVersionName()} 🚧`,
label: `${getNextBetaVersionName()} 🚧`,
},
},
},
Expand Down

0 comments on commit f16b858

Please sign in to comment.