-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·62 lines (49 loc) · 1.51 KB
/
make.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
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#
# Script to track resources used by https://verifier.globalnames.org
#
function track_script {
# first track this script
preston track "file://$PWD/$0"
}
function track_content {
# then track the content
preston track "http://opendata.globalnames.org/dwca/"\
| grep "hash://sha256"\
| preston cat\
| grep -P -o "[0-9a-zA-Z-]+.(tar.gz|zip)"\
| sed 's+^+http://opendata.globalnames.org/dwca/+g'\
| xargs preston track
}
function generate_readme {
echo -e "This publication contains a Preston archive of resources used by Global Names Verifier (https://verifier.globalnames.org/about)." > README.md
echo -e "\n\nPlease follow academic citation guidelines when using this corpus." | tee -a README.md
echo -e "\n\nTo clone this archive:"\
| tee -a README.md
echo -e "\n\n$ preston clone"\
| tee -a README.md
echo -e "\n\nAfter cloning this archive, you should be able to reproduce results below without the --remote https://zenodo.org... part."\
| tee -a README.md
echo -e "\n\n$ preston history\n\n"\
| tee -a README.md
preston history\
| tee -a README.md
echo -e "\n\nResource Alias/References\n\n$ preston alias -l tsv | cut -f1 | sort | uniq\n\n" | tee -a README.md
preston alias -l tsv\
| cut -f1\
| sort\
| uniq\
| tee -a README.md
# build the citation list
echo -e "\n\nReferences\n\n"\
| tee -a README.md
echo generating citation list
preston ls\
| preston cite\
| sort\
| uniq\
| tee -a README.md
}
track_script
track_content
generate_readme