2024-04-14 06:14:09 +02:00
|
|
|
#!/bin/sh
|
2023-12-09 00:00:47 +01:00
|
|
|
|
|
|
|
|
# This script is a wrapper for the main server, CLI and Prisma binaries.
|
|
|
|
|
# Commands:
|
|
|
|
|
# - `start`: Starts the server
|
|
|
|
|
# - `cli`: Starts the CLI, sends all arguments to it
|
|
|
|
|
|
|
|
|
|
# Exit immediately if a command exits with a non-zero status.
|
2024-04-14 15:27:50 +02:00
|
|
|
set -eu
|
2023-12-09 00:00:47 +01:00
|
|
|
|
2024-04-07 13:38:17 +02:00
|
|
|
cd /app/dist
|
2024-04-07 10:56:15 +02:00
|
|
|
|
2023-12-09 00:00:47 +01:00
|
|
|
# Parse first argument
|
|
|
|
|
case "$1" in
|
|
|
|
|
"start")
|
2024-04-15 07:08:16 +02:00
|
|
|
NODE_ENV=production bun run ./index.js --prod
|
2023-12-09 00:00:47 +01:00
|
|
|
;;
|
|
|
|
|
"cli")
|
|
|
|
|
# Start the CLI
|
|
|
|
|
shift 1
|
2024-04-07 13:34:21 +02:00
|
|
|
bun run ./cli.js "$@"
|
2023-12-09 00:00:47 +01:00
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
# Run custom commands
|
|
|
|
|
exec "$@"
|
|
|
|
|
;;
|
2024-04-07 13:37:00 +02:00
|
|
|
esac
|