Files
prop-ai-hr/scripts/dev-frontend.sh
T

21 lines
613 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR/frontend"
if [[ ! -d node_modules ]]; then
npm install --registry=https://registry.npmmirror.com
fi
if [[ "${PORTLESS:-1}" != "0" ]] && command -v portless >/dev/null 2>&1; then
exec portless run --name wygj-admin --force bash -lc 'npm run dev -- --host "${HOST:-127.0.0.1}" --port "$PORT" --strictPort'
fi
if [[ "${PORTLESS:-1}" != "0" ]]; then
echo "portless is not available; falling back to http://127.0.0.1:5173/." >&2
fi
exec npm run dev -- --host 127.0.0.1 --port 5173 --strictPort