Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ tidy:
# Start the API with Air hot-reload. The database is the shared one in the dev
# cluster, so `make forward-db` must already be running in another terminal —
# checked here because otherwise the failure is a bare "connection refused".
# The probe is bash's /dev/tcp rather than nc: netcat is not installed by
# default on every distro, and a missing nc made this check report the tunnel
# as down when it was up.
dev:
@nc -z localhost $(DB_PORT) 2>/dev/null || { \
@bash -c 'exec 3<>/dev/tcp/localhost/$(DB_PORT)' 2>/dev/null || { \
echo "Nothing listening on localhost:$(DB_PORT)."; \
echo "Start the tunnel to the shared dev database first, in another terminal:"; \
echo ""; \
Expand Down