aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/files/datacite/casecreate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/files/datacite/casecreate.sh')
-rwxr-xr-xpython/tests/files/datacite/casecreate.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/tests/files/datacite/casecreate.sh b/python/tests/files/datacite/casecreate.sh
new file mode 100755
index 00000000..82655dc3
--- /dev/null
+++ b/python/tests/files/datacite/casecreate.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# casecreate.sh creates a new test case file pair by copying the last one.
+#
+set -eo pipefail
+
+max=$(find . -name 'datacite_doc_*' | sort -n | tail -1 | grep -Eo '[0-9]+')
+if [ -z $max ]; then
+ echo "failed, expected datacite_doc_[NUMBER]..."
+ exit 1
+fi
+new=$((max+1))
+cp "datacite_doc_$max.json" "datacite_doc_$new.json"
+cp "datacite_result_$max.json" "datacite_result_$new.json"
+
+[ -f ./caseview.sh ] && ./caseview.sh "$new"