Skip to content

Commit eed011e

Browse files
authored
Wait for published version to be available (#546)
* Wait for published version to be available * Sleep before publishing so the user has an opportunity to quit
1 parent 06375c3 commit eed011e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

_automate/publish.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,17 @@ for crate in ${ORDER[@]}; do
2323
cd $crate
2424
VERSION=$(grep "^version" ./Cargo.toml | sed -e 's/.*"\(.*\)"/\1/')
2525
echo "Publishing $crate@$VERSION"
26-
sleep 5
26+
sleep 5 # give the user an opportunity to abort before publishing
2727
cargo publish $@ || read -p ">>>>> Publishing $crate failed. Press [enter] to continue. "
28+
echo " Waiting for published version $VERSION to be available..."
29+
CRATE_NAME=$(grep "^name" ./Cargo.toml | sed -e 's/.*"\(.*\)"/\1/')
30+
LATEST_VERSION=0
31+
while [[ $LATEST_VERSION != $VERSION ]]
32+
do
33+
sleep 3
34+
LATEST_VERSION=$(cargo search "$CRATE_NAME" | grep "^$CRATE_NAME =" | sed -e 's/.*"\(.*\)".*/\1/')
35+
echo " Latest available version: $LATEST_VERSION"
36+
done
2837
cd -
2938
done
3039

0 commit comments

Comments
 (0)