17 lines
380 B
Bash
Executable File
17 lines
380 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
bind_addr="${1:-0.0.0.0}"
|
|
port="${2:-3000}"
|
|
|
|
if [ -x "./node_modules/.bin/next" ]; then
|
|
exec ./node_modules/.bin/next dev -H "$bind_addr" -p "$port"
|
|
else
|
|
if command -v npx >/dev/null 2>&1; then
|
|
exec npx --yes next dev -H "$bind_addr" -p "$port"
|
|
else
|
|
echo "Next.js binary not found and npx not available" >&2
|
|
exit 1
|
|
fi
|
|
fi
|