File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,25 @@ if [ -n "${CODER_AGENT_URL:-}" ]; then
72
72
fi
73
73
74
74
# Preflight checks: ensure we have our required dependencies, and make sure nothing is listening on port 3000 or 8080
75
- dependencies curl git go make pnpm
76
- 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
77
- 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
75
+ dependencies curl git go jq make pnpm
76
+
77
+ if curl --fail http://127.0.0.1:3000 > /dev/null 2>&1 ; then
78
+ # Check if this is the Coder development server.
79
+ if curl --silent --fail http://127.0.0.1:3000/api/v2/buildinfo 2>&1 | jq -r ' .version' > /dev/null 2>&1 ; then
80
+ echo ' == INFO: Coder development server is already running on port 3000!' && exit 0
81
+ else
82
+ echo ' == ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1
83
+ fi
84
+ fi
85
+
86
+ if curl --fail http://127.0.0.1:8080 > /dev/null 2>&1 ; then
87
+ # Check if this is the Coder development frontend.
88
+ if curl --silent --fail http://127.0.0.1:8080/api/v2/buildinfo 2>&1 | jq -r ' .version' > /dev/null 2>&1 ; then
89
+ echo ' == INFO: Coder development frontend is already running on port 8080!' && exit 0
90
+ else
91
+ echo ' == ERROR: something is listening on port 8080. Kill it and re-run this script.' && exit 1
92
+ fi
93
+ fi
78
94
79
95
# Compile the CLI binary. This should also compile the frontend and refresh
80
96
# node_modules if necessary.
You can’t perform that action at this time.
0 commit comments