cap-set-version-from-package is a simple CLI for updating Android or iOS version with package.json version
npm install cap-set-version-from-package
!NPM
!npm
!GitHub code size in bytes
!Snyk Vulnerabilities for npm scoped package
cap-set-version-from-package CLI is a simple utility for updating your Android or iOS build no. and version by using package.json while creating Android or iOS App using Capacitor. Very Useful in Github action for capacitor.
``bash`
npm install cap-set-version-from-package
Install it in your capacitor/ionic project
To use this package just use the below command
`bash
cap-set-version-from-package
If you are using npx then no need to install, directly use this
`bash
npx cap-set-version-from-package
`$3
You must have package.json file with update version. You may have android or ios directory added to your capacitor project using:
`bash
to install capacitor Android dependency
npm install @capacitor/android @capacitor/androidto add Android directory
npx cap add androidto add ios directory
npx cap add iosto clone your dist to android
npx cap sync`
Incase if any directory is missing, still it will work on existing directory with a WARNING.
Once done. Now you are ready to use cap-set-version-from-packageCustomise Your Versioning
$3
If Android folder is getting created or available in custom location.
npm
`bash
cap-set-version-from-package --androidPath=../Project2/androidOR use short form
csvfp -a=../Project2/android`npx
`bash
npx cap-set-version-from-package -a=../Project2/android
`$3
If ios folder is getting created or available in custom location.
npm
`bash
cap-set-version-from-package --iosPath=../Project2/iosOR use short form
csvfp -i=../Project2/android`npx
`bash
npx cap-set-version-from-package -i=../Project2/ios
`$3
If package.json is available in custom location or you want use some custom json file.
npm
`bash
cap-set-version-from-package --jsonPath=./Project2/custom.jsonOR use short form
csvfp -j=./Project2/custom.json
`npx
`bash
npx cap-set-version-from-package --jsonPath=../Project2/package.json
`$3
If custom json file contain custom key which contains version.
npm
`bash
cap-set-version-from-package --versionKey=proj-versionOR use short form
csvfp -k=proj-version
`npx
`bash
npx cap-set-version-from-package -j=./Project2/custom.json -k=versionName
`For developers and contibuters
To install package
`bash
npm install
`To use locally in system
`bash
npm i -g
`To remove it locally
`bash
npm rm -g
``- Versioning iOS build.
- Customization for iOS build versioning.
- Picking paths from capacitor.config.json.