From 8f3086daa996d764b0705dd36921a89a69d7805e Mon Sep 17 00:00:00 2001 From: Alexander Zaytsev Date: Wed, 15 Apr 2026 20:54:11 +0200 Subject: [PATCH] Pretty-print dev server URL and login in `bin/dev` (#2808) * Make dev server URL and login info look nicer * DRY * Adjust comments * Adjust comments --- bin/dev | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/dev b/bin/dev index 991de00c7..c8174be61 100755 --- a/bin/dev +++ b/bin/dev @@ -4,6 +4,15 @@ PORT=3006 USE_TAILSCALE=0 USE_PUSH=0 +if [ -t 1 ]; then + c_bar='\033[2mâ–Ž\033[0m' # dim + c_label='\033[37m' # gray + c_url='\033[96m' # cyan + c_reset='\033[0m' +else + c_bar='â–Ž' c_label='' c_url='' c_reset='' +fi + for arg in "$@"; do case $arg in --tailscale) USE_TAILSCALE=1 ;; @@ -58,9 +67,14 @@ if [ "$USE_TAILSCALE" = "1" ]; then echo "Error: tailscale serve failed. On Linux, run once: sudo tailscale set --operator=\$USER" >&2 exit 1 fi - echo "Login with david@example.com to: https://$TS_HOSTNAME:$TS_PORT/" + DEV_URL="https://$TS_HOSTNAME:$TS_PORT/" else - echo "Login with david@example.com to: http://app.fizzy.localhost:$PORT/" + DEV_URL="http://app.fizzy.localhost:$PORT/" fi +printf "\n" +printf " ${c_bar} ${c_label}URL${c_reset} ${c_url}${DEV_URL}${c_reset}\n" +printf " ${c_bar} ${c_label}Login${c_reset} david@example.com\n" +printf "\n" + ./bin/rails server -b 0.0.0.0 -p $PORT