#!/bin/bash

set -e

cd "$(dirname "$0")"
cd ..

if [ -f "node_modules/.bin/ts-node" ]; then
  TSC="node_modules/.bin/tsc"
else
  TSC="../../../node_modules/.bin/tsc"
fi

echo -e "Building @grouparoo/core API..."

START_TIME=$(date +%s);

rm -rf dist
$TSC --declaration

END_TIME=$(date +%s);

echo -e "@grouparoo/core API built in $(($END_TIME - $START_TIME))s"
echo -e ""
