I have an Ionic app running on Angular 8 w/ npm and I have my app's version number in several places that need to be updated before each release. I've seen npm version
and I'm looking for something like that, that works in additional files as well. Currently, my app's version number is referenced in:
main.yml
package.json
config.xml
app/pages/login/login.html
app/providers/sentry.service.ts
I didn't know if there would be a tool or simply a global search and replace but either would be okay by me.
If it's possible avoid duplicating the version number in the application. The angular app can read it from the package.json
import pkg from './package.json';
console.log(pkg.version);
I would expect it would cover app/pages/login/login.html
and app/providers/sentry.service.ts
.
For the rest, I would consider cordova hook before_compile
. I believe the small script which would set the version would be the fast and reliable solution.