feat: respect RELEASE_VERSION env variable

This commit is contained in:
LongYinan 2020-09-13 22:06:10 +08:00
parent bff691cf20
commit f93fe8dcc6
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -9,7 +9,11 @@ export function getNapiConfig(packageJson = 'package.json') {
(platform: string) => `${platform}-musl`,
)
const platforms = os
const version = packageVersion
const releaseVersion = process.env.RELEASE_VERSION
const releaseVersionWithoutPrefix = releaseVersion?.startsWith('v')
? releaseVersion.substr(1)
: releaseVersion
const version = releaseVersionWithoutPrefix ?? packageVersion
const packageName = name
const binaryName = napi?.name ?? 'index'