-
Notifications
You must be signed in to change notification settings - Fork 79
/
run.sh
executable file
·42 lines (38 loc) · 887 Bytes
/
run.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
#!/bin/sh
export PYTHONPATH=".:$PYTHONPATH"
export DJANGO_SETTINGS_MODULE="test_settings"
PROG="$0"
CMD="$1"
shift
usage() {
echo "USAGE: $PROG [command]"
echo " test - run the adminplus tests"
echo " lint - run flake8 (alias: flake8)"
echo " shell - open the Django shell"
echo " build - build a package for release"
echo " check - run twine check on build artifacts"
exit 1
}
case "$CMD" in
"test" )
echo "Django version: $(python -m django --version)"
python -m django test adminplus
;;
"lint"|"flake8" )
echo "Flake8 version: $(flake8 --version)"
flake8 "$@" adminplus/
;;
"shell" )
python -m django shell
;;
"build" )
rm -rf dist/*
python -m build
;;
"check" )
twine check dist/*
;;
* )
usage
;;
esac