#!/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

# 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 -f tsconfig.tsbuildinfo

pnpm run installTranslations
pnpm run build:es
pnpm run build:types
cp src/rce_allowlist.json es/rce_allowlist.json
