spartaksun / composer-bump-plugin
Composer plugin for incremention a package version.
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: >=7.1
- composer-plugin-api: ^1.1
- ext-json: *
- composer/composer: ^1.9
This package is auto-updated.
Last update: 2025-01-20 05:21:27 UTC
README
Install
composer require-dev spartaksun/composer-bump-plugin
Usage
composer bump
After plugin package installed you will be able to call composer bump
command.
Without any additional arguments it will increment a patch part of version mentioned in composer.json.
Command will also create a backup copy of composer.json
in composer.json-backup
file.
Increment patch part of a version
composer bump patch
For example: 1.0.3 => 1.0.4
Increment minor part of a version and reset patch
composer bump minor
For example: 1.0.3 => 1.1.0
Increment major part of a version and reset patch and minor
composer bump major
For example: 1.17.34 => 2.0.0
Change default indentation in composer.json
composer bump -i 4
This command will change indentation in composer.json to 4 spaces/tabs
Nex command will increment minor, set indentation to 2 and disable creating of backup file.
composer bump minor -i 2 no-backup
Callbacks
You may optionally specify callbacks scripts in your composer.json
:
{ "scripts": { "pre-bump": "./my_script.sh", "post-bump": "bin/console post:bump" } }
pre-bump
script will be called before incrementing a version with argument --old-version
.
post-bump
script will be called after version is incremented with arguments --old-version
and --new-version
added to your script.