From d6675a76a152c7ba9c0625700fe6d43c8b52a441 Mon Sep 17 00:00:00 2001 From: Akira Kawata Date: Tue, 6 Feb 2024 23:34:59 +0900 Subject: [PATCH] Add check file --- .../scripts/check_update_all_generated_DBs.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 jendeley-backend/scripts/check_update_all_generated_DBs.sh diff --git a/jendeley-backend/scripts/check_update_all_generated_DBs.sh b/jendeley-backend/scripts/check_update_all_generated_DBs.sh new file mode 100755 index 0000000..28daf87 --- /dev/null +++ b/jendeley-backend/scripts/check_update_all_generated_DBs.sh @@ -0,0 +1,17 @@ +#! /bin/bash +set -eux + +rootdir=$(git rev-parse --show-toplevel) +workdir=$(mktemp -d -t jendeley_check_update_all_generated_DBs_XXXXX) +cd ${rootdir}/jendeley-backend + +ok=0 +for db in $(find ${rootdir}/jendeley-backend/generated_DBs -name "*.json" | sort); do + echo Checking $db + node --require source-map-support/register dist/index.js update_db --db1 ${db} --db2 ${workdir}/updated_$(basename $db) + if [[ ! -f ${workdir}/updated_$(basename $db) ]]; then + ok=1 + fi +done +echo Check ${workdir} for updated DBs +exit $ok