1 |
9491
|
aaronmk
|
#!/bin/sh -e
|
2 |
5414
|
aaronmk
|
# Test-scrubs the test taxonomic names
|
3 |
|
|
|
4 |
|
|
selfDir="$(dirname -- "$0")"
|
5 |
|
|
selfDirName="$(basename -- "$selfDir")"
|
6 |
|
|
|
7 |
9487
|
aaronmk
|
unset n
|
8 |
|
|
|
9 |
5414
|
aaronmk
|
cd "$selfDir/../.."
|
10 |
|
|
|
11 |
5423
|
aaronmk
|
# Import names
|
12 |
5812
|
aaronmk
|
make inputs/.TNRS/reinstall schema_only=1 # asks user for confirmation
|
13 |
5668
|
aaronmk
|
# Must come after TNRS reinstall to recreate tnrs_input_name view
|
14 |
5414
|
aaronmk
|
make schemas/public/reinstall # asks user for confirmation
|
15 |
|
|
make inputs/"$selfDirName"/import log=
|
16 |
9489
|
aaronmk
|
make inputs/.TNRS/tnrs/tnrs-remake log=
|
17 |
|
|
yes|make schemas/public/reinstall
|
18 |
|
|
make inputs/.TNRS/import log=
|
19 |
|
|
make inputs/"$selfDirName"/import log=
|
20 |
5423
|
aaronmk
|
|
21 |
|
|
# Export results
|
22 |
|
|
# Don't overwrite TNRS.backup, which contains the full TNRS cache
|
23 |
|
|
make backups/TNRS.sql-remake
|
24 |
|
|
mv -f backups/TNRS.sql "$selfDir/_scrub"
|
25 |
5680
|
aaronmk
|
public=public."$selfDirName"
|
26 |
9490
|
aaronmk
|
make schemas/"$public"/uninstall # remove previous results
|
27 |
5680
|
aaronmk
|
make schemas/rename/"$public"
|
28 |
|
|
make backups/"$public".sql-remake
|
29 |
|
|
mv -f backups/"$public".sql "$selfDir/_scrub"
|
30 |
10788
|
aaronmk
|
rm=1 inputs/.TNRS/data.sql.run export_
|