From f93fe8dcc6c08dfaf8c4a21eb82851086e0369cb Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 13 Sep 2020 22:06:10 +0800 Subject: [PATCH] feat: respect RELEASE_VERSION env variable --- src/consts.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/consts.ts b/src/consts.ts index 576ca5b4..e5f7ddbe 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -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'