Skip to content

Commit

Permalink
fixes for postversion-commit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Oct 2, 2024
1 parent dee8ed7 commit 6a1b32f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 1 addition & 9 deletions scripts/postversion-commit.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down

0 comments on commit 6a1b32f

Please sign in to comment.