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();