-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_bib.sh
executable file
·21 lines (18 loc) · 1.02 KB
/
update_bib.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
BIBFILES="authors.bib abbrev.bib journals.bib articles.bib biblio.bib crossref.bib"
for file in $BIBFILES; do
# echo $file
curl --silent https://raw.githubusercontent.com/iridia-ulb/references/master/${file} -o ${file}
done
tmpbib=$(mktemp --tmpdir tmpXXXXXXXXXX.bib)
keys=$(cat bibkeys.txt | paste -d '#' -s | sed 's/#/\\\|/g')
bib2bib --warn-error --expand --expand-xrefs --no-comment --quiet --expand-xrefs $BIBFILES --remove pdf --remove alias -c "(\$key : \"$keys\")" -ob $tmpbib -oc /dev/null
# Workaround https://github.com/GeoBosh/rbibutils/issues/9
sed -i 's#\\slash #~/ #g' $tmpbib
sed -i 's#\\hspace{0pt}#{}{}{}#g' $tmpbib
# Work around broken URL:
sed -i 's%researchrepository.napier.ac.uk/id/eprint/3044%lopez-ibanez.eu/publications#LopezIbanezPhD%g' $tmpbib
comment='% DO NOT EDIT THIS FILE. It is auto-generated by "update_bib.sh".'
echo $comment | cat --squeeze-blank - $tmpbib > r/inst/REFERENCES.bib
echo $comment | cat --squeeze-blank - $tmpbib > python/doc/source/REFERENCES.bib
rm -f $BIBFILES $tmpbib