-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
How to version my app #2486
Comments
You could make a script that reads the version, then calls |
Do you mean you want the current version number rendered into the HTML? Alternatively, you can do something like this during build: # First add '<!-- version: %VERSION% -->' to your public/index.html file
$ yarn run build
$ VERSION=`git rev-parse --abbrev-ref HEAD`
$ sed -i -- "s/%VERSION%/$VERSION/g" build/index.html Now your build/index.html should contain |
Also, see the ideas on #2466 where they use the version in the |
I'll close this as answered. |
@uidevperson There are many different UNIX* ways to do this. What you ultimately need to do is figure out the version of the app and make this string available as an environment variable before running REACT_APP_CURRENT_GIT_SHA=`git rev-parse --short HEAD` yarn run build The other option, as mentioned above is to inject it into the built |
I'm using git flow. I name my releases by version number. For example v1.02. I'd like to be able to run a git command: git rev-parse --abbrev-ref HEAD to get the current branch. Then parse out the version number from the branch and stick that into my page somewhere. What would be the best way to do that?
The text was updated successfully, but these errors were encountered: