This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Commit 850d703 1 parent 113b002 commit 850d703 Copy full SHA for 850d703
File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
usage () {
4
4
cat << EOF
5
- usage: $0 [major|minor|patch]
5
+ usage: $0 [major|minor|patch|-preXYZ ]
6
6
7
7
Increments the Cargo.toml version.
8
8
A minor version increment is the default
@@ -33,7 +33,8 @@ SPECIAL=""
33
33
semverParseInto " $( readCargoVersion ./Cargo.toml) " MAJOR MINOR PATCH SPECIAL
34
34
[[ -n $MAJOR ]] || usage
35
35
36
- currentVersion=" $MAJOR .$MINOR .$PATCH "
36
+ currentVersion=" $MAJOR .$MINOR .$PATCH$SPECIAL "
37
+ SPECIAL=" "
37
38
38
39
case ${1:- minor} in
39
40
patch)
@@ -45,20 +46,23 @@ major)
45
46
minor)
46
47
MINOR=$(( MINOR+ 1 ))
47
48
;;
49
+ -* )
50
+ SPECIAL=" $1 "
51
+ ;;
48
52
* )
49
53
echo " Error: unknown argument: $1 "
50
54
usage
51
55
;;
52
56
esac
53
57
54
- newVersion=" $MAJOR .$MINOR .$PATCH "
58
+ newVersion=" $MAJOR .$MINOR .$PATCH$SPECIAL "
55
59
56
60
# shellcheck disable=2044 # Disable 'For loops over find output are fragile...'
57
61
for Cargo_toml in $( find . -name Cargo.toml) ; do
58
62
# Bump crate version
59
63
(
60
64
set -x
61
- sed -i " $Cargo_toml " -e " s/^version = \" [^\" ]\" $/version = \" $newVersion \" /"
65
+ sed -i " $Cargo_toml " -e " s/^version = \" [^\" ]* \" $/version = \" $newVersion \" /"
62
66
)
63
67
64
68
# Fix up the internal references to the solana_program_interface crate
You can’t perform that action at this time.
0 commit comments