2024-04-13 18:14:09 -10:00
|
|
|
#!/bin/sh
|
2023-12-08 13:00:47 -10: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 03:27:50 -10:00
|
|
|
set -eu
|
2023-12-08 13:00:47 -10:00
|
|
|
|
2024-04-07 01:38:17 -10:00
|
|
|
cd /app/dist
|
2024-04-06 22:56:15 -10:00
|
|
|
|
2023-12-08 13:00:47 -10:00
|
|
|
# Parse first argument
|
|
|
|
|
case "$1" in
|
|
|
|
|
"start")
|
2024-04-14 19:08:16 -10:00
|
|
|
NODE_ENV=production bun run ./index.js --prod
|
2023-12-08 13:00:47 -10:00
|
|
|
;;
|
|
|
|
|
"cli")
|
|
|
|
|
# Start the CLI
|
|
|
|
|
shift 1
|
2024-05-08 00:24:21 +00:00
|
|
|
bun run ./cli/index.js "$@"
|
2023-12-08 13:00:47 -10:00
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
# Run custom commands
|
|
|
|
|
exec "$@"
|
|
|
|
|
;;
|
2024-04-07 01:37:00 -10:00
|
|
|
esac
|