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
postversion with yarn does not work as expected #58
Comments
Whoa, nice find! Is it possible that this variable name was also changed in some new version of npm, or is it really yarn only? |
Not sure, I was testing inside project with
and husky precommit enabled. |
Well, nevertheless, I think we can just add another |
Right, another |
I'm seeing the same problem and @suside 's workaround works. Would be great if it can be fixed. |
So it seems they do have different names It seems that another |
Fix #58 Check yarn npm_config_version_git_tag
When you add
"postversion": "react-native-version"
and run
npm version --new-version patch
you will end up with latest tag and HEAD having fallowing files updated:
and that is the expected behavior.
But when you do the same with
yarn version --new-version patch
your tag will have only:
(with HEAD being ok)
I figured out that this happens because
yarn
is settingprocess.env.npm_config_version_git_tag
instead
process.env.npm_config_git_tag_version
which is then read here:
react-native-version/index.js
Lines 500 to 502 in 0642d25
I'm not sure if
yarn
is officially supported but the workaround is to use:"postversion": "react-native-version --amend"
it should work with both
npm
andyarn
The text was updated successfully, but these errors were encountered: