-
Notifications
You must be signed in to change notification settings - Fork 1
/
bump.sh
executable file
·26 lines (24 loc) · 840 Bytes
/
bump.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
case "$1" in
"")
echo you need to supply major, minor or patch
exit 1;;
"major")
echo Releasing a new Major version
perl -pi -e 's/(version = ")(\d+)\.(\d+)\.(\d+)/$1.($2+1).".".$3.".".$4/ge' Project.toml
git commit -am "chore: bumped version in Project.toml."
npx standard-version -r=major;;
"minor")
echo "Releasing a new Minor version"
perl -pi -e 's/(version = ")(\d+)\.(\d+)\.(\d+)/$1.$2.".".($3+1).".".$4/ge' Project.toml
git commit -am "chore: bumped version in Project.toml."
npx standard-version -r=minor;;
"patch")
echo "Releasing a new Patch version"
perl -pi -e 's/(version = ")(\d+)\.(\d+)\.(\d+)/$1.$2.".".$3.".".($4+1)/ge' Project.toml
git commit -am "chore: bumped version in Project.toml."
npx standard-version -r=patch;;
*)
echo "Dude, something is _off_!"
exit 1;;
esac