- Notifications
You must be signed in to change notification settings - Fork2
License
kt3k/bmp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Version up. No hassles.
bmp
is a command line tool for updating the version number in source files.
It's common to have the version number of the library written in multiple placesin a repository, e.g. metadata files, documetation, source code, etc.
If the version number of the library written more than 1 place, updating thesenumbers in every release is boring, error prone chore.bmp
helps thatsituation with simple config file.bmp.yml
which can track every occurence ofthe version number in a repository and updates every occurence consistently.
deno install --global --allow-env --allow-read=. --allow-write=. --allow-run=git -qf jsr:@kt3k/bmp@0.3.2
This installsbmp
command.
Hit the below command to initialize the config file:
bmp -i# or bump --init
This creates a config file like the below:
.bmp.yml
version:0.0.0commit:"chore: bump version to %.%.%"files:README.md:v%.%.%
version
is the current version of your repository. You need to set this tothe actuall current version number.commit
is the commit message which is used when you perform the commandbmp -c
, which commits the change, and cut the tag. This field is optional,and you can delete this if you don't want to use committing feature.files
contains the version number patterns in files. For example, if yourREADME.md file containsmy-library v1.2.3
, then you need to set thisproperty toREADME.md: my-library v%.%.%
. (As you can see%.%.%
partrepresents the version number)bmp
doesn't parse your files. So you can listany files with any syntax.
Then you need to modify this file to fit the existing state of your repository.It might look something like the below, for example:
version:0.4.3commit:"chore: bump version to v%.%.%"files:README.md: -v%.%.% -my-lib@%.%.%main.ts:'const version = "%.%.%";'
Then hit the commandbmp
(no options). This validates the occurencies of thepatterns in each file. If the config has any error, the command shows it. If theconfig finds every pattern in every file, you'll see the output like the below:
Current version: 0.4.3Commit message: chore: bump to 0.4.3Version patterns: README.md: v0.0.2 README.md: my-lib@0.0.2 main.ts: const version = "0.4.3";
Now you are all set. You can bump the versoin by the commandsbmp -j
(major),bmp -m
(minor),bmp -p
(patch). The tool also supportspreid
(likealpha.1
orbeta.2
). Seebmp -h
output for more details.
Creates .bmp.yml file with placeholders.
Checks and validates the config file.
Bump the patch version and updates every version occurrences based on .bmp.ymlconfig.
bmp -m
for minor version bump,bmp -j
for major version bump.
Commits the current change in the git repository with the commit messagespecified in .bmp.yml config and cut the tag.
Patch version up, commits the change, and cut the tag.
Alsobmp -mc
for minor,bmp -jc
for major.
MIT
- 2023-02-08 v0.2.0 Allow glob as files key#2
This tool was ported from the ruby version:https://github.com/kt3k/ruby-bmp