web-4/backend/build-frontend.sh
2024-12-24 03:25:01 +03:00

25 lines
502 B
Bash
Executable File

#!/bin/bash
# Go to frontend directory
cd ../frontend
# Install dependencies and build
npm install
npm run build
# Save swagger-ui.html
cd ../backend/src/main/webapp
cp swagger-ui.html /tmp/swagger-ui.html
# Remove old files except WEB-INF
find . -mindepth 1 -maxdepth 1 ! -name 'WEB-INF' -exec rm -rf {} +
# Copy new build files
cp -r ../../../../frontend/build/* .
# Restore swagger-ui.html
cp /tmp/swagger-ui.html .
rm /tmp/swagger-ui.html
# Return to backend directory
cd ../../../../backend