-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·77 lines (66 loc) · 1.35 KB
/
run.sh
File metadata and controls
executable file
·77 lines (66 loc) · 1.35 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
run_init()
{
pip3 install build
}
run_clean()
{
rm -rf build dist shellwrap.egg-info
}
run_build()
{
#python3 setup.py sdist bdist_wheel
python3 -m build # the new way
}
run_install()
{
pip3 install dist/shellwrap-0.0.3-py3-none-any.whl
}
run_test()
{
#python3 -m unittest discover -s ./test -p 'test*.py'
python3 -m unittest discover
}
run_lint()
{
pylint shellwrap
#pylint *.py shellwrap \
# --disable=duplicate-code \
# --extension-pkg-allow-list=math \
# --ignore-patterns=".*\.md,.*\.sh,.*\.html,pylintrc,LICENSE,build,dist,tags,shellwrap.egg-info"
}
run_help()
{
fmt="%4s %s\\n"
printf "$fmt" flag meaning
printf "$fmt" -h help
printf "$fmt" -c clean
printf "$fmt" -b build
printf "$fmt" -I init
printf "$fmt" -i install
printf "$fmt" -t test
printf "$fmt" -l lint
printf "$fmt" -u uninstall
printf "$fmt" -v "set version"
}
# Process the command line arguments
while getopts "hcbIitlu" opt
do
case ${opt} in
h) run_help ;;
c) run_clean ;;
b) run_build ;;
I) run_init ;;
i) run_install ;;
t) run_test ;;
l) run_lint ;;
u) pip3 uninstall shellwrap ;;
v) set_version $OPTARG ;;
*) run_help ; exit ;;
esac
done
# default, no options given, run these tasks
if [[ $# -eq 0 ]] ; then
run_lint
run_test
fi