-
Notifications
You must be signed in to change notification settings - Fork 8
/
update.sh
executable file
路58 lines (40 loc) 路 1.05 KB
/
update.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
update=${1:-p}
# WARNING ERRORONOUS AND CONTAINS SIDEEFFECTS
if [[ $(git diff --stat) != '' ]]; then
echo "dirty git. will not continue"
exit 0
fi
branch=$(git branch | grep '*' | cut -d' ' -f2)
if [[ "$branch" != 'latest' ]]; then
echo "not on latest branch. will not continue"
exit 0
fi
echo "We will be releasing a $update update ($(git vb $update -d))"
read -r -p "Are you sure? [y/N] " response
if [[ "$response" =~ ^(yes|y)$ ]]
then
echo "processing"
sleep 1
echo "Update CLI usage"
source venv/bin/activate
pip install -e .
ih --version
python demo/update_readme.py
git add README.md && git commit -m "update cli usage"
echo "bump"
git version-bump $update
echo "use new version"
pip install -e .
ih --version
# Hard-copy from README.md example
ih -p alpaca -r -c 4 demo/demo_image.png -f demo/
deactivate
echo "Update demo render"
node demo/update_render.js
git add demo/ && git commit -m "update demo render"
git release
git push
else
echo "user bailed. will not continue"
fi