Skip to content

Commit abe17b9

Browse files
committed
chore: ensure coder is logged before querying orgs
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 78f9f43 commit abe17b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/develop.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,10 @@ fatal() {
162162
# Check if credentials are already set up to avoid setting up again.
163163
"${CODER_DEV_SHIM}" list >/dev/null 2>&1 && touch "${PROJECT_ROOT}/.coderv2/developsh-did-first-setup"
164164

165-
if [ ! -f "${PROJECT_ROOT}/.coderv2/developsh-did-first-setup" ]; then
165+
if ! "${CODER_DEV_SHIM}" whoami >/dev/null 2>&1; then
166166
# Try to create the initial admin user.
167+
echo "Login required; use admin@coder.com and password '${password}'" >&2
168+
167169
if "${CODER_DEV_SHIM}" login http://127.0.0.1:3000 --first-user-username=admin --first-user-email=admin@coder.com --first-user-password="${password}" --first-user-full-name="Admin User" --first-user-trial=false; then
168170
# Only create this file if an admin user was successfully
169171
# created, otherwise we won't retry on a later attempt.

0 commit comments

Comments
 (0)