forked from snipsco/snips-nlu-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_version.sh
executable file
·25 lines (21 loc) · 1.29 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
25
#!/usr/bin/env bash
NEW_VERSION=${1?"usage $0 <new version>"}
echo "Updating versions to version ${NEW_VERSION}"
perl -p -i -e "s/^version = \".*\"\$/version = \"$NEW_VERSION\"/g" */Cargo.toml
perl -p -i -e "s/^version = \".*\"\$/version = \"$NEW_VERSION\"/g" */**/**/Cargo.toml
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_VERSION \".*\"/SNIPS_VERSION \"$NEW_VERSION\"/g" snips-nlu-ffi/c/libsnips_nlu.h
echo "$NEW_VERSION" > snips-nlu-ffi/python/snips_nlu_rust/__version__
if [[ "${NEW_VERSION}" == "${NEW_VERSION/-SNAPSHOT/}" ]]
then
perl -p -i -e "s/snips-nlu-rs\", tag = \".*\"/snips-nlu-rs\", tag = \"$NEW_VERSION\"/g" \
snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
perl -p -i -e "s/snips-nlu-rs\", branch = \".*\"/snips-nlu-rs\", tag = \"$NEW_VERSION\"/g" \
snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
else
perl -p -i -e "s/snips-nlu-rs\", branch = \".*\"/snips-nlu-rs\", branch = \"develop\"/g" \
snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
perl -p -i -e "s/snips-nlu-rs\", tag = \".*\"/snips-nlu-rs\", branch = \"develop\"/g" \
snips-nlu-ffi/python/snips-nlu-python-ffi/Cargo.toml
fi