-
Notifications
You must be signed in to change notification settings - Fork 56
/
update_version.sh
executable file
·24 lines (19 loc) · 1.12 KB
/
update_version.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
#!/usr/bin/env bash
NEW_VERSION=${1?"usage $0 <new version>"}
echo "Updating versions to version ${NEW_VERSION}"
find . -name "Cargo.toml" -exec perl -p -i -e "s/^version = \".*\"$/version = \"$NEW_VERSION\"/g" {} \;
find . -name "cbindgen.toml" -exec perl -p -i -e "s/^header = \"#define SNIPS_NLU_VERSION.*\"$/header = \"#define SNIPS_NLU_VERSION \\\\\"${NEW_VERSION}\\\\\"\"/g" {} \;
perl -p -i -e "s/^version = \".*\"\$/version = \"$NEW_VERSION\"/g" */**/build.gradle
perl -p -i -e "s/^VERSION=\".*\"\$/VERSION=\"$NEW_VERSION\"/g" */**/**/**/build.sh
perl -p -i -e "s/SNIPS_NLU_VERSION \".*\"/SNIPS_NLU_VERSION \"$NEW_VERSION\"/g" platforms/c/libsnips_nlu.h
echo "$NEW_VERSION" > platforms/python/snips_nlu_rust/__version__
if [[ "${NEW_VERSION}" == "${NEW_VERSION/-SNAPSHOT/}" ]]
then
perl -p -i -e \
"s/^snips-nlu-ffi = \{.*\}$/snips-nlu-ffi = { git = \"https:\/\/github.com\/snipsco\/snips-nlu-rs\", tag = \"$NEW_VERSION\" }/g" \
platforms/python/ffi/Cargo.toml
else
perl -p -i -e \
"s/^snips-nlu-ffi = \{.*\}$/snips-nlu-ffi = { path = \"..\/..\/..\/ffi\" }/g" \
platforms/python/ffi/Cargo.toml
fi