bson/specdata/update.sh
raw| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | if [ ! -d specifications ]; then |
| 6 | git clone -b bson [email protected]:jyemin/specifications |
| 7 | fi |
| 8 | |
| 9 | TESTFILE="../specdata_test.go" |
| 10 | |
| 11 | cat <<END > $TESTFILE |
| 12 | package bson_test |
| 13 | |
| 14 | var specTests = []string{ |
| 15 | END |
| 16 | |
| 17 | for file in specifications/source/bson/tests/*.yml; do |
| 18 | ( |
| 19 | echo '`' |
| 20 | cat $file |
| 21 | echo -n '`,' |
| 22 | ) >> $TESTFILE |
| 23 | done |
| 24 | |
| 25 | echo '}' >> $TESTFILE |
| 26 | |
| 27 | gofmt -w $TESTFILE |