8000 Added a script to update the version number · java64/ArduinoJson@f139100 · GitHub
[go: up one dir, main page]

Skip to content

Commit f139100

Browse files
committed
Added a script to update the version number
1 parent 3f666bd commit f139100

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

scripts/set-version.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
cd "$(dirname $0)/.."
6+
7+
VERSION="$1"
8+
IFS=".-" read MAJOR MINOR REVISION EXTRA < <(echo "$VERSION")
9+
TAG="v$VERSION"
10+
UNDERLINE=$(printf -- '-%.0s' $(seq 1 ${#TAG}))
11+
12+
sed -i~ -bE "4s/HEAD/$TAG/; 5s/-+/$UNDERLINE/" CHANGELOG.md
13+
rm CHANGELOG.md*~
14+
sed -i~ -bE "s/\"version\":.*$/\"version\": \"$VERSION\",/" library.json
15+
rm library.json*~
16+
17+
sed -i~ -bE "s/version=.*$/version=$VERSION/" library.properties
18+
rm library.properties*~
19+
20+
sed -i~ -bE \
21+
-e "s/ARDUINOJSON_VERSION .*$/ARDUINOJSON_VERSION \"$VERSION\"/" \
22+
-e "s/ARDUINOJSON_VERSION_MAJOR .*$/ARDUINOJSON_VERSION_MAJOR $MAJOR/" \
23+
-e "s/ARDUINOJSON_VERSION_MINOR .*$/ARDUINOJSON_VERSION_MINOR $MINOR/" \
24+
-e "s/ARDUINOJSON_VERSION_REVISION .*$/ARDUINOJSON_VERSION_REVISION $REVISION/" \
25+
src/ArduinoJson/version.hpp
26+
rm src/ArduinoJson/version.hpp*~

0 commit comments

Comments
 (0)
0