I made this script so that each time your npm version changes in your project you can have the same version reflected in you config.xml
.
npm install npm-cordova-version-sync -g
cd /path/to/project
ncvs init
And that is it! The script will insert a command to run automatically when you version your project via npm!
If you don't want to run this automatically you can run the following command to copy the version number found in your package.json
into your config.xml
.
ncvs version
You may want to change what ncvs init
places automatically into your project. This is useful if your files are not in the root of your project.
-
packageLocation : path to your
package.json
(default: 'package.json') -
configXmlLocation : path to you
config.xml
(default: 'config.xml') -
jsonSpacing : number of spaces used for formatting your
package.json
(default: 2)
Example:
ncvs version --packageLocation=app/package.json --configXmlLocation=app/package.json --jsonSpacing=4