From 6a1b32f13dca40affc76a0caf99185e9ec339ac1 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 2 Oct 2024 11:26:24 -0400 Subject: [PATCH] fixes for postversion-commit.js --- package.json | 2 +- scripts/postversion-commit.js | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 2bd2c40..d20afb1 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "clean": "rimraf build/*", "postversion": "yarn postversion:check && yarn postversion:commit && yarn postversion:push", "postversion:check": "yarn lint && yarn test", - "postversion:commit": "VERSION=v$npm_package_version && node scripts/postversion-commit.js", + "postversion:commit": "node scripts/postversion-commit.js", "postversion:push": "git push && git push --tags", "prepublish": "yarn lint && yarn test", "prepack": "yarn clean && yarn build" diff --git a/scripts/postversion-commit.js b/scripts/postversion-commit.js index 2482221..7a1d0f0 100644 --- a/scripts/postversion-commit.js +++ b/scripts/postversion-commit.js @@ -1,19 +1,11 @@ import {execSync} from 'node:child_process'; -import assert from 'node:assert/strict'; +import {version} from '../package.json'; /** * Utility for committing and tagging a release commit in * git, called as part of the `yarn postversion` script. */ -const version = process.env.VERSION; - -assert.match( - version, - /^v\d+\.\d+\.\d+[a-zA-Z0-9\._-]*$/, - 'Missing or invalid process.env.VERSION' -); - const currentBranch = execSync('git rev-parse --abbrev-ref HEAD') .toString() .trim();