23 lines
No EOL
544 B
Bash
Executable file
23 lines
No EOL
544 B
Bash
Executable file
#!/bin/bash
|
|
# Make the script exit when a command fails.
|
|
set -e
|
|
|
|
# Define a cleanup function to handle CTRL-C (SIGINT)
|
|
cleanup() {
|
|
echo "CTRL-C caught! Shutting down Docker Compose services..."
|
|
docker compose down
|
|
exit 1
|
|
}
|
|
|
|
# Set trap to call cleanup() when SIGINT (Ctrl-C) is received.
|
|
trap cleanup SIGINT
|
|
|
|
# Restart compose services.
|
|
echo "Restarting compose services..."
|
|
docker compose down
|
|
docker compose up -d
|
|
|
|
docker compose exec web bash -c "cd /code/theme/static_src && npm run dev" || true
|
|
|
|
docker compose down
|
|
echo "Done!" |