Waits for the Vite dev server to respond on :5173, then opens it in the default browser via xdg-open/open, falling back to printing the URL.
26 lines
536 B
Bash
Executable File
26 lines
536 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
export DOTNET_ROOT="${DOTNET_ROOT:-/home/james/.dotnet}"
|
|
|
|
WEB_URL="http://localhost:5173"
|
|
|
|
open_browser() {
|
|
until curl -sf "$WEB_URL" >/dev/null 2>&1; do
|
|
sleep 1
|
|
done
|
|
if command -v xdg-open >/dev/null 2>&1; then
|
|
xdg-open "$WEB_URL" >/dev/null 2>&1 &
|
|
elif command -v open >/dev/null 2>&1; then
|
|
open "$WEB_URL" >/dev/null 2>&1 &
|
|
else
|
|
echo "Open $WEB_URL in your browser"
|
|
fi
|
|
}
|
|
|
|
open_browser &
|
|
|
|
dotnet run --project src/Novelly.AppHost
|