#!/bin/bash

if [ -z "$1" ]; then
  echo "Ошибка: Пожалуйста, укажите директорию назначения."
  exit 1
fi
DESTINATION_DIR=$1

echo "Building Angular app for embedding..."
# ng build --configuration production --output-path ../../golang/gin-restapi/weather-front
rm -rf "$DESTINATION_DIR"
npx ng build --configuration production 

mkdir -p "$DESTINATION_DIR"

cp -r /home/su/projects/angular/project-front/dist/project-front/browser/* \
    "$DESTINATION_DIR"

echo "Build completed successfully!"
echo "Frontend files are ready for embedding in Go binary" 