Skip to content

Commit

Permalink
[GH-169] chore: update pre-commit hook to check package json version
Browse files Browse the repository at this point in the history
  • Loading branch information
pablojvritx committed Jun 6, 2024
1 parent 830a854 commit d919a65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

LAST_TAG=$(git describe --tags --abbrev=0)

CURRENT_VERSION=$(node -p "require('./package.json').version")

if [ "$LAST_TAG" = "v$CURRENT_VERSION" ]; then
npm --no-git-tag-version version minor
git add package.json package-lock.json

echo "Bumped version to $(node -p "require('./package.json').version")"
fi

npm run pre-commit
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d919a65

Please sign in to comment.