forked from clementprevot/pyduro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·43 lines (33 loc) · 1.01 KB
/
publish.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
#!/bin/env bash
function usage() {
echo """
./publish.sh [-h] [-r <repository name>]|[-p]|[-t]
-h - Display this help message
-r <repository name> - Publish the package to the given repository (whose name should be available in .pypirc)
-p - Publish the package to the public PyPi repository (you should have a 'pypi' repository in you .pypirc)
-t - Default - Publish the package to the test PyPi repository (you should have a 'testpypi' repository in you .pypirc)
"""
exit 0
}
REPOSITORY="testpypi"
while getopts hpr:t option; do
case "${option}" in
h)
usage
;;
r)
REPOSITORY=${OPTARG}
;;
p)
REPOSITORY="pypi"
;;
t)
REPOSITORY="testpypi"
;;
*)
usage
;;
esac
done
echo -e "Publishing the package to '${REPOSITORY}'...\n"
python -m twine upload --repository $REPOSITORY dist/*