Comments (14)
Looks like HEAD
isn't pointing to any Git tag. Is that correct?
Thought: Maybe RNV should just skip adjusting Git tags when it doesn't find any, instead of throwing.
from react-native-version.
Yes you are maybe correct. Such a behaviour would be great
from react-native-version.
@VinceBT New version (2.6.1) is out now on npm.
from react-native-version.
I used --amend to try your modification and got the same error, I'm on 2.6.1
Could the &&
be the reason of the bug here ? :
Line 507 in f5228b0
EDIT: Changing it to || did nothing
from react-native-version.
Hm, weird. Here's what I just tried:
$ npm version patch
$ react-native-version -a
# commit amended, git tag adjusted
$ npm version patch
# another test commit
$ react-native-version -a
# commit amended, no git tag adjusted
LGTM
from react-native-version.
Could you reopen this issue ? I still don't have the amend working even with latest version :(
from react-native-version.
I'm going to need a reproducible example in order to dig deeper.
From your description I gather that you have something like a monorepo with multiple projects or apps in it. This shouldn't be a problem. However, about Git tags... Do you utilize them somehow in the other apps? Do you skip tag creation (--no-git-tag-version
or disabling in npm config) when using npm version ...
or are you using default settings?
AFAIK Git tags are global inside a repo, so they can be overwritten by the other apps.
from react-native-version.
I think my issue is related to this npm/npm#9111
Since my app is inside a subfolder, it doesnt not create a tag, so there is nothing to amend.
I've adapted my package.json to look like that:
But when using npm version, it creates two tags now:
EDIT:
I think this ticket can be closed and a second known issue can be added to your readme haha
If you can help me on the double tag issue tell me if I need to create a second issue of if there is a simple fix
from react-native-version.
Hm, wasn't aware of this. Maybe a check that Git exists in that directory should also be added. npm version
simply skips tag creation if there isn't a .git/
directory. I think we should mirror that behaviour.
from react-native-version.
@VinceBT Can you try out react-native-version@next
(2.6.3-0) and see if that works ok?
from react-native-version.
When using your new version I get this output and no git tag
[RNV] Versioning Android...
[RNV] Android updated
[RNV] Versioning iOS...
[RNV] iOS updated
[RNV] Amending...
[RNV] Done
But when creating a .git folder, I get this output and a git tag
[RNV] Versioning Android...
[RNV] Android updated
[RNV] Versioning iOS...
[RNV] iOS updated
[RNV] Amending...
[RNV] Adjusting Git tag...
[RNV] Done
The [RNV] Adjusting Git tag...
step is triggered in the second case
I dont have the double tag issue anymore
from react-native-version.
Yeah, but isn't that what we want?
With "preversion": "mkdir .git"
, when you run npm version
and the Git tag for that version does not exist in your repo, it will create the tag and proceed with "postversion": "react-native-version --amend"
, which will find the tag and adjust it to point to the amended commit.
If the Git tag already exists in the repo, npm version
will throw an error because it does not use the --force
option like RNV does.
But I have found and issue in the case when there is no .git/
folder, npm version
will skip creating a Git tag and will not even commit the changes in package.json
. RNV will then do its work and amend the current commit in error. The same commit validation we do for determining when to search for Git tags should be added before amending.
from react-native-version.
For me this was happening when I would try and run the react-native-version
script without committing my changes. It seems that you can only run this script once per commit? Otherwise I'd get the error you shared above.
from react-native-version.
I fixed the problem by adding the missing .git
folder to the apps/mobile
folder.
Q. How can I check if my folder is missing?
A. I checked on vs code
for this.
- Open
Settings
-> Search or typeexclude
-> find the pattern**/.git
, remove it temporarily, and clickok
. - Check for the
.git
folder in the main project directory and theapps/mobile
folder. - If the
.git
folder is not in theapps/mobile
folder, create it. [Leave it empty] - Now, execute your command, like
yarn mobile:staging:release
.
from react-native-version.
Related Issues (20)
- increse buildNumber on hot reload HOT 1
- Just to verify: there is NO option to NOT let the tool commit into git? HOT 2
- increase with widget targers version
- Command failed with exit code 127
- Support for multiple info plist files?
- npm version [major/minor/patch] is not updating all the files
- I don't want to increase verssion on all Project HOT 2
- fatal: No names found, cannot describe anything. HOT 1
- SUPPORT
- Support iOS Extensions target HOT 2
- Cannot increase only build number
- Change version for a specific IOS target
- Rely on an argument for expo and react-native projects
- versionName and CFBundleShortVersionString dont output the expected inputs
- Fails when xCode has more targets (multiple Info.plis)
- What's an alternative to this package? HOT 2
- Need monorepo support
- How can I also customize updating files to add for example updating OneSignal version and build Id ?
- Add --skip-expo option to skip Expo versioning even if detected HOT 1
- SyntaxError: Expected "\"", "\\'", "\\\"", "\\n", or [^\\"] but "\\" found. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-version.