-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdist.sh
More file actions
55 lines (46 loc) · 818 Bytes
/
Copy pathdist.sh
File metadata and controls
55 lines (46 loc) · 818 Bytes
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
#!/usr/bin/env bash
name="crudlib"
function install() {
package
pip uninstall -y $name
for x in `ls dist/*.whl`; do pip install $x; done
}
function package() {
clean
pip install -U wheel twine setuptools
python3 setup.py sdist bdist_wheel
}
function clean() {
rm -rf build/ *.egg-info/ dist/
find . -name "__pycache__" | xargs rm -rf
}
function publish() {
package
twine upload dist/*
}
function usage() {
echo "Usage: sh dist.sh [clean|package|install|publish]"
exit 1
}
function test() {
echo "TEST"
exit 0
}
#根据输入参数,选择执行对应方法,不输入则执行使用说明
case "$1" in
"clean")
clean
;;
"install")
install
;;
"package")
package
;;
"publish")
publish
;;
*)
usage
;;
esac