#! /usr/bin/env bash
#
# Set up opam and install opam packages required to build and test atd
#
# This is used by the Dockerfile and by the CI build.
#
set -eu

eval "$(opam env)"

# Set up the opam repo (skip if already done, e.g. from a restored cache).
if ! opam repo list | grep -q '^github\b'; then
  opam repo add --all-switches -k git \
    github https://github.com/ocaml/opam-repository.git
  opam repo remove default
fi
# no need for 'opam update'

./scripts/install-opam-dependencies
