#!/usr/bin/env bash
set -e

# We make the directories if they don't exist so that the following delete commands work outside of docker.  These
# directories are automatically created via volume mounts when using docker, so the -p flag prevents these commands
# from failing
mkdir -p lib
mkdir -p es
mkdir -p canvas

# We can't delete the directories themselves when inside docker because they are the volume mount points, so instead we
# delete everything in them.
rm -rf lib/*
rm -rf es/*
rm -rf canvas/*

JEST_WORKER_ID=true ./node_modules/.bin/babel --out-dir lib src --ignore '**/__tests__'
./node_modules/.bin/babel --out-dir es src --ignore '**/__tests__'
cp -r lib locales README.md package.json canvas
