#!/usr/bin/env bash

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SOURCE_FILE="${ROOT_DIR}/scripts/.env.validation.example"
TARGET_FILE="${1:-}"

if [[ -z "${TARGET_FILE}" ]]; then
  echo "Usage: bash scripts/bootstrap_validation_env.sh <target-env-file>"
  echo "Example: bash scripts/bootstrap_validation_env.sh /tmp/mkt.validation.env"
  exit 1
fi

if [[ -f "${TARGET_FILE}" ]]; then
  echo "Target file already exists: ${TARGET_FILE}"
  exit 1
fi

cp "${SOURCE_FILE}" "${TARGET_FILE}"

echo "Created validation env template:"
echo "  ${TARGET_FILE}"
