forked from jazzband/django-waffle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·38 lines (34 loc) · 1.1 KB
/
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
#!/bin/bash
export PYTHONPATH=".:$PYTHONPATH"
export DJANGO_SETTINGS_MODULE="test_settings"
usage() {
echo "USAGE: $0 [command]"
echo " test - run the waffle tests"
echo " lint - run flake8"
echo " typecheck - run mypy"
echo " shell - open the Django shell"
echo " makemigrations - create a schema migration"
exit 1
}
CMD="$1"
shift
case "$CMD" in
"test" )
DJANGO_SETTINGS_MODULE=test_settings django-admin test waffle $@ ;;
"lint" )
flake8 waffle $@ ;;
"typecheck" )
mypy waffle $@ ;;
"shell" )
django-admin shell $@ ;;
"makemigrations" )
django-admin makemigrations waffle $@ ;;
"makemessages" )
export DJANGO_SETTINGS_MODULE= && cd waffle && django-admin makemessages --all && cd - ;;
"compilemessages" )
export DJANGO_SETTINGS_MODULE= && cd waffle && django-admin compilemessages && cd - ;;
"find_uncommitted_translations" )
git diff --exit-code -G "^(msgid|msgstr)" || (echo "Please run ./run.sh makemessages and commit the updated django.po file." && false) ;;
* )
usage ;;
esac