forked from uzi/statkeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrefresh
More file actions
executable file
·39 lines (29 loc) · 694 Bytes
/
refresh
File metadata and controls
executable file
·39 lines (29 loc) · 694 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
#!/bin/bash
DATABASE="statkeeper.db"
FIXTURE="match/fixtures/initial_data.json"
NOINPUT='--noinput'
APPS="auth sessions match"
case $1 in
restore)
# Takes a fixture and creates a fresh db from it
# delpyc
find . -name '*.py[co]' -exec rm -v {} \;
# Rebuild the database
rm -f $DATABASE
./manage.py syncdb $NOINPUT
;;
dump)
# Creates a new fixture from the db
FIXTUREDIR=`dirname $FIXTURE`
mkdir -p $FIXTUREDIR
echo "Writing $FIXTURE ..."
./manage.py dumpdata $APPS --indent=2 > $FIXTURE
;;
pyflakes)
# Checks the pythons
find * -name '*.py' | xargs pyflakes
;;
*)
echo "Usage: $0 [dump|restore]"
;;
esac