Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw [error] instead of [info] on yarn version --no-git-tag-version --new-version <my version>; Needed during git pre-commit hook #8127

Open
DmytroSokhach opened this issue May 15, 2020 · 0 comments

Comments

@DmytroSokhach
Copy link

My current pre-commit hook looks like this:
"pre-commit": "yarn version --no-git-tag-version --new-version \"$(gitversion -showvariable MajorMinorPatch)\" && lint-staged",

Problem:
During commit, all changes are commited as expected and then package.json version is updated, which forces to make another commit. (We can do git amend when code was not pushed, but this not always obvious)

Expected:

  1. I need ability to tell the "pre-commit" to exit with error, or do "exit 1" when "yarn version" actually changes the files on disk.
  2. When the version is the same, the package.json contents will not be changed, and this should not throw any error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant