zotero/scripts/update-citeproc.sh

33 lines
669 B
Bash
Raw Permalink Normal View History

#!/bin/bash -e
2023-04-23 09:05:39 +00:00
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
tag=master
if [ -n "$1" ]; then
tag=$1
fi
echo Downloading tag $tag
sleep 2
2023-04-23 09:05:39 +00:00
outFile="$ROOT_DIR/chrome/content/zotero/xpcom/citeproc.js"
if [ ! -e "$outFile" ]; then
2023-04-23 09:05:39 +00:00
>&2 echo "$outFile not found"
exit 78 # EX_CONFIG: configuration error (from sysexits.h)
fi
curl -f https://raw.githubusercontent.com/Juris-M/citeproc-js/$tag/citeproc.js > "$outFile"
echo
if [ `command -v acorn` ]; then
echo "Verifying file..."
acorn --silent "$outFile"
if [ $? = 0 ]; then
echo "OK"
fi
else
echo "Warning: acorn isn't installed -- not verifying file"
fi