-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.sh
56 lines (49 loc) · 1.03 KB
/
push.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
#!/bin/bash
# check os
echo "check os"
is_Windows=false
uNames=`uname -s`
osName=${uNames: 0: 4}
if [ "$osName" == "Darw" ] # Darwin
then
echo "Mac OS X"
elif [ "$osName" == "Linu" ] # Linux
then
echo "GNU/Linux"
elif [ "$osName" == "MING" ] # MINGW, windows, git-bash
then
is_Windows=true
echo "Windows, git-bash"
else
echo "unknown os"
fi
# check if twine is installed
echo "check if twine is installed"
twine --version
if [ $? -ne 0 ]
then
echo "twine is not installed, will install it first! "
# install twine
pip install twine
fi
# delete old dist
if $is_Windows
then
echo "delete old dist on Windows, git-bash"
rmdir dist build zhei.egg-info /s /q
else
echo "delete old dist on Mac OS X or GNU/Linux"
rm -rf dist build *.egg-info
fi
# pip install twine
python setup.py build sdist
twine upload dist/*
# delete dist
if $is_Windows
then
echo "delete dist on Windows, git-bash"
rmdir dist build zhei.egg-info /s /q
else
echo "delete dist on Mac OS X or GNU/Linux"
rm -rf dist build *.egg-info
fi