#!/bin/bash PKG_DIR="./packages/frontend" OUTPUT_DIR="${PKG_DIR}/build" DEST_DIR=${1:-/data} if [[ -d "$DEST_DIR" ]]; then echo "${DEST_DIR} already exists." 1>&2 exit 1 fi if [[ -f "$PKG_DIR/.env" ]]; then echo "Using existing .env file" else mv "$PKG_DIR/.env.example" "$PKG_DIR/.env" echo "Created .env file. Please populate with the correct values." exit 1 fi cat > $PKG_DIR/.env <&2 exit 1 fi mv "$OUTPUT_DIR" "$DEST_DIR"