2022-03-10 17:01:50 +01:00
|
|
|
const { version: manifestVersion } = require('../../package.json');
|
|
|
|
const { BuildType } = require('./build-type');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current version of the MetaMask extension. The base manifest version
|
|
|
|
* is modified according to the build type and version.
|
|
|
|
*
|
|
|
|
* The build version is needed because certain build types (such as beta) may
|
|
|
|
* be released multiple times during the release process.
|
|
|
|
*
|
|
|
|
* @param {BuildType} buildType - The build type.
|
|
|
|
* @param {number} buildVersion - The build version.
|
|
|
|
* @returns {string} The MetaMask extension version.
|
|
|
|
*/
|
|
|
|
function getVersion(buildType, buildVersion) {
|
2023-03-04 13:51:04 +01:00
|
|
|
return buildType === BuildType.main || buildType === BuildType.beta
|
2022-03-10 17:01:50 +01:00
|
|
|
? manifestVersion
|
|
|
|
: `${manifestVersion}-${buildType}.${buildVersion}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = { getVersion };
|