forked from alpacahq/alpaca-trade-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.sh
executable file
·34 lines (24 loc) · 939 Bytes
/
tag.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
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
VER_FILE="alpaca_trade_api/__init__.py"
# This script simply sets up the repo for a new tag
echo "Current version number is: "
grep "__version__" $VER_FILE
read -r -p "Please enter a new version number to bump to: " VERSION
echo -e "Updating init.py to $VERSION\n"
sed -i -e "s/__version__ = .*/__version__ = '$VERSION'/" $VER_FILE
read -r -n 1 -p "Would you like to git commit and tag now? (y/N): " YN
# there are better ways to get this in but 🤷
echo ""
case $YN in
y|Y )
echo "Okay, committing this change";
git commit -m "Version bump to $VERSION" -m "This commit was auto generated by a tool!"
git tag -a "v$VERSION" -m "Version bump to $VERSION" -m "This tag was auto generated by a tool!"
git tag --sort -refname | head -n 5
echo "Done!"
;;
* )
echo -e "Okay exiting now. $VER_FILE has still been edited to contain the new version\nFair warning!"
exit 0
;;
esac