File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # This script is used to fetch the latest version of a JSON test from the specification repository
4+ # You can pass it the relative path to a spec file and it will fetch the latest version of the test
5+ # Example usage from driver root directory:
6+ # $ ./etc/update-spec-test.sh crud/tests/unified/deleteMany-let.json
7+
8+ set -o errexit
9+ set -o nounset
10+
11+ if [ ! -d " .git" ]; then
12+ echo " $0 : This script must be run from the root of the repository" >&2
13+ exit 1
14+ fi
15+
16+ if [ $# -ne 1 ]; then
17+ echo " $0 : This script must be passed exactly one argument for which test to sync" >&2
18+ exit 1
19+ fi
20+
21+ spec_root=" Tests/Specs"
22+
23+ tmpdir=` perl -MFile::Temp=tempdir -wle ' print tempdir(TMPDIR => 1, CLEANUP => 0)' `
24+ curl -sL https://github.com/mongodb/specifications/archive/master.zip -o " $tmpdir /specs.zip"
25+ unzip -d " $tmpdir " " $tmpdir /specs.zip" > /dev/null
26+
27+ touch " $spec_root /$1 "
28+ rsync -ah " $tmpdir /specifications-master/source/$1 " " $spec_root /$1 " --delete
29+
30+ rm -rf " $tmpdir "
You can’t perform that action at this time.
0 commit comments