#!/bin/sh

set -ex

# As of 3 Jan 2019, Travis defaults to bundler 2.0 - https://docs.travis-ci.com/user/languages/ruby/#bundler-20
# Linguist still requires Bundler 1.x due to Licensed.
gem uninstall -v '>= 2' -ax bundler || true
gem install bundler -v '< 2'

# Fetch all commits/refs needed to run our tests.
git fetch origin master:master v2.0.0:v2.0.0 test/attributes:test/attributes test/master:test/master

# Replace SSH links to submodules by HTTPS links.
sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules

git submodule init
git submodule sync --quiet
script/fast-submodule-update
