-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathreparse_all.sh
executable file
·51 lines (38 loc) · 1.2 KB
/
reparse_all.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
43
44
45
46
47
48
49
50
51
#!/bin/bash
trap ctrl_c INT
function ctrl_c() {
exit 1;
}
if [ -z "$1" ]; then
TODAY=$(date +%Y%m%d)
DATADIR=data.$TODAY
else
DATADIR=$1
fi
senapy-cli doslegs_urls | tlfp-parse-many $DATADIR --only-promulgated
echo
echo "Handle non promulgated texts already parsed in data:"
ls data/ | grep '^p' | grep -v '_tmp' | while read id; do
ls $DATADIR/$id > /dev/null 2>&1 ||
ls $DATADIR/logs/$id > /dev/null 2>&1 ||
tlfp-parse $id $DATADIR
done
echo
python tlfp/generate_dossiers_csv.py $DATADIR
python tlfp/tools/assemble_procedures.py $DATADIR
python tlfp/tools/make_metrics_csv.py $DATADIR
python tlfp/tools/steps_as_dot.py $DATADIR | dot -Tsvg > $DATADIR/steps.svg
python tlfp/tools/steps_as_dot.py $DATADIR | dot -Tpng > $DATADIR/steps.png
python tlfp/tools/steps_as_dot.py $DATADIR 1 | dot -Tsvg > $DATADIR/steps-detailed.svg
python tlfp/tools/steps_as_dot.py $DATADIR 1 | dot -Tpng > $DATADIR/steps-detailed.png
for f in .htaccess HEADER.html; do
cp data/$f $DATADIR/$f
done
echo "Everything finished, data processed in $DATADIR"
echo "A few stats:"
echo
./stats.sh $DATADIR
echo
echo "Deploy built data with:"
echo "mv data data.$TODAY.old && mv $DATADIR data"
./stats.sh $DATADIR