Skip to content

Commit a26bd6e

Browse files
committed
Add auto-upgrade support for SDK deps
This automates the SDK upgrade step of the release process.
1 parent aa95dcc commit a26bd6e

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎release.sh‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@ do
2424
latestver=`yarn info -s $i dist-tags.next`
2525
if [ "$depver" != "$latestver" ]
2626
then
27-
echo "The latest version of $i is $latestver but package.json depends on $depver"
28-
echo -n "Type 'Yes' to continue anyway: "
27+
echo "The latest version of $i is $latestver but package.json depends on $depver."
28+
echo -n "Type 'u' to auto-upgrade, 'c' to continue anyway, or 'a' to abort:"
2929
read resp
30-
if [ "$resp" != "Yes" ]
30+
if [ "$resp" != "u" ] && [ "$resp" != "c" ]
3131
then
32-
echo "OK, never mind."
32+
echo "Aborting."
3333
exit 1
3434
fi
35+
if [ "$resp" == "u" ]
36+
then
37+
echo "Upgrading $i to $latestver..."
38+
yarn add -E $i@$latestver
39+
git add -u
40+
# The `-e` flag opens the editor and gives you a chance to check
41+
# the upgrade for correctness.
42+
git commit -m "Upgrade $i to $latestver" -e
43+
fi
3544
fi
3645
done
3746

0 commit comments

Comments
 (0)