#!/bin/bash

set -e

# Figure out the current compiler
CURRENT=$(opam switch -list | grep '*' | cut -f 2 -d " ")

echo Switching to system
opam switch system > /dev/null
eval `opam config -env`

echo Running "oasis setup"
oasis setup

echo Switching back to $CURRENT
opam switch $CURRENT > /dev/null
eval `opam config -env`
