Skip to content

Commit

Permalink
chore: Add devtools/bump.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyr committed Jul 15, 2022
1 parent 22c837d commit c5d2db6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions devtools/bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -e
set -u
[ -n "${DEBUG:-}" ] && set -x || true

main() {
if [ $# != 1 ]; then
echo "bump.sh version" >&2
exit 1
fi
local v="$1"
find . -name 'Cargo.toml' -print0 | xargs -0 sed -i.bak \
-e 's/^version = .*/version = "'"$v"'"/' \
-e 's/\({.*path = ".*",.* version = "= \)[^"]*/\1'"$v"'/'
find . -name 'Cargo.toml.bak' -exec rm -f {} \;
cargo check
}

main "$@"

0 comments on commit c5d2db6

Please sign in to comment.