mapnik/scripts/ensure_test_data.sh

21 lines
786 B
Bash
Raw Normal View History

2016-09-06 09:00:37 +02:00
#!/usr/bin/env bash
set -eu
set -o pipefail
VERSION=$(git describe)
if [[ -d .git ]]; then
git submodule update --init
else
if [[ ! -d ./test/data ]]; then
echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz"
2016-09-06 09:20:48 +02:00
mkdir -p test/data/
2016-09-06 09:00:37 +02:00
curl -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/
fi
2016-09-06 09:20:48 +02:00
if [[ ! -d ./test/data-visual ]]; then
echo "Downloading visual test data from https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz"
mkdir -p test/data-visual/
curl -L -s https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data-visual/
fi
2016-09-06 09:00:37 +02:00
fi