From 7d2a915a76e2af99e9594ab68e47fe9b077496b0 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 13 Aug 2025 11:19:17 +0100 Subject: [PATCH 1/2] chore: improve message when running develop.sh multiple times --- scripts/develop.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/develop.sh b/scripts/develop.sh index 5a802735c7c66..de38b38e6e951 100755 --- a/scripts/develop.sh +++ b/scripts/develop.sh @@ -72,9 +72,25 @@ if [ -n "${CODER_AGENT_URL:-}" ]; then fi # Preflight checks: ensure we have our required dependencies, and make sure nothing is listening on port 3000 or 8080 -dependencies curl git go make pnpm -curl --fail http://127.0.0.1:3000 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1 -curl --fail http://127.0.0.1:8080 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 8080. Kill it and re-run this script.' && exit 1 +dependencies curl git go jq make pnpm + +if curl --fail http://127.0.0.1:3000 >/dev/null 2>&1; then + # Check if this is the Coder development server. + if curl --silent --fail http://127.0.0.1:3000/api/v2/buildinfo 2>&1 | jq -r '.version' >/dev/null 2>&1; then + echo '== INFO: Coder development server is already running on port 3000!' && exit 0 + else + echo '== ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1 + fi +fi + +if curl --fail http://127.0.0.1:8080 >/dev/null 2>&1; then + # Check if this is the Coder development frontend. + if curl --silent --fail http://127.0.0.1:8080/api/v2/buildinfo 2>&1 | jq -r '.version' >/dev/null 2>&1; then + echo '== INFO: Coder development frontend is already running on port 8080!' && exit 0 + else + echo '== ERROR: something is listening on port 8080. Kill it and re-run this script.' && exit 1 + fi +fi # Compile the CLI binary. This should also compile the frontend and refresh # node_modules if necessary. From 5ae9d234bb44b03f55976af52a9ef1a8f6217428 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 13 Aug 2025 11:38:45 +0100 Subject: [PATCH 2/2] Update scripts/develop.sh Co-authored-by: Mathias Fredriksson --- scripts/develop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/develop.sh b/scripts/develop.sh index de38b38e6e951..23efe67576813 100755 --- a/scripts/develop.sh +++ b/scripts/develop.sh @@ -74,7 +74,7 @@ fi # Preflight checks: ensure we have our required dependencies, and make sure nothing is listening on port 3000 or 8080 dependencies curl git go jq make pnpm -if curl --fail http://127.0.0.1:3000 >/dev/null 2>&1; then +if curl --silent --fail http://127.0.0.1:3000; then # Check if this is the Coder development server. if curl --silent --fail http://127.0.0.1:3000/api/v2/buildinfo 2>&1 | jq -r '.version' >/dev/null 2>&1; then echo '== INFO: Coder development server is already running on port 3000!' && exit 0