Skip to content

Commit

Permalink
chore: add bash script to handle update
Browse files Browse the repository at this point in the history
my bash is way out of date, but this is a simple script to handle
checking out the desired tag in the submodule, updating the version and
hash in the `__init__.py` file, and then running `gen_proto.sh`.
  • Loading branch information
gforsyth committed Sep 27, 2023
1 parent 348a7b7 commit bb39632
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [[ -z "$1" ]]; then
echo "Usage: bash update.sh version" 1>&2
echo ""
echo "Example: bash update.sh v0.34.0" 1>&2
exit 1
fi

VERSION=$1

pushd third_party/substrait/
git checkout $VERSION
SUBSTRAIT_HASH=$(git rev-parse --short HEAD)
popd

VERSION=$(echo $VERSION | sed 's/v//')

sed -i "s#__substrait_hash__.*#__substrait_hash__ = \"$SUBSTRAIT_HASH\"#g" src/substrait/__init__.py
sed -i "s#__substrait_version__.*#__substrait_version__ = \"$VERSION\"#g" src/substrait/__init__.py

./gen_proto.sh

0 comments on commit bb39632

Please sign in to comment.