Code Monkey home page Code Monkey logo

capacitor-set-version's Introduction

capacitor-set-version

Write version number and build number for Android and iOS on ionic/capacitor projects


Build With
oclif semantic release

Installation

Use with npx without install:

  npx capacitor-set-version [DIR] -v <value> -b <value> [--json]

install as a development dependency:

  npm i -D capacitor-set-version

or install globally:

  npm i -g capacitor-set-version

How it works

Calling capacitor-set-version will set your Android and iOS app versions and build number to the values passed as flags.

For Android, build number means the versionCode option and in iOS it will be CFBundleVersion.

Options

Flags bellow are used to change the default behavior.

USAGE
  $ capacitor-set-version [DIR] -v <value> -b <value> [--json]

ARGUMENTS
  DIR  Capacitor project root directory

OPTIONS
  -b, --build=10       App build number (Integer)
  -v, --version=x.x.x  App version
  --json               Print errors and result as JSON
  -h, --help           Show help

Setting version for iOS or Android only

If you need to update the version in only one platform, you can use the commands "set:ios" or "set:android", accordingly.

# Set android version only
capacitor-set-version set:android -v 1.1.1 -b 100 ./my-app

# Set ios version only
capacitor-set-version set:ios -v 1.1.1 -b 100 ./my-app

Usage

Examples

# Set version to 1.2.3 and build number to 10 on current folder.
capacitor-set-version -v 1.2.3 -b 10

# Set version of project on folder ./my-app
capacitor-set-version -v 1.2.3 -b 10 ./my-app

# Set android only version and build number
capacitor-set-version set:android -v 1.2.3-rc1 -b 1546 ./my-app

# Set iOS version only
capacitor-set-version set:ios -v 1.2.3 -b 10 ./my-app

Migrating from version 1.x.x

A lot of changes were made from version 1.x.x, with some features being removed. Bellow is a list of all braking changes:

  • Removed reading the version from package.json;
  • Removed auto-increment for version and build numbers;
  • Flags -v and -b are now mandatory;
  • Replaced flags for ios and android with commands "set:ios" and "set:android".

If you need any of these features back, open up an issue relating your use case.


Hausenn Technologies

capacitor-set-version's People

Contributors

dependabot[bot] avatar dkrepsky avatar semantic-release-bot avatar bosh-code avatar akomelj avatar iamso avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.