From d76737b30b0b1747aadc03365e1a011c6387a230 Mon Sep 17 00:00:00 2001 From: Bryan Date: Tue, 1 Feb 2022 18:02:59 -0800 Subject: [PATCH] fix: Adjust ./develop.sh script to run in ./site (#142) Hopefully the last thing I missed in #128 ... this fixes the `./develop.sh` script and `site/dev.ts` to account for the new pathing of `package.json`. --- develop.sh | 15 ++++++++++----- site/dev.ts | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/develop.sh b/develop.sh index 1a9239e395..13aeb63421 100755 --- a/develop.sh +++ b/develop.sh @@ -14,11 +14,11 @@ function create_initial_user() { # TODO: We need to wait for `coderd` to spin up - # need to replace with a deterministic strategy sleep 5s - + curl -X POST \ - -d "{\"email\": \"$EMAIL\", \"username\": \"$USERNAME\", \"organization\": \"$ORGANIZATION\", \"password\": \"$PASSWORD\"}" \ - -H 'Content-Type:application/json' \ - http://localhost:3000/api/v2/user + -d "{\"email\": \"$EMAIL\", \"username\": \"$USERNAME\", \"organization\": \"$ORGANIZATION\", \"password\": \"$PASSWORD\"}" \ + -H 'Content-Type:application/json' \ + http://localhost:3000/api/v2/user } # Do initial build - a dev build for coderd. @@ -29,4 +29,9 @@ make bin/coderd # This is a way to run multiple processes in parallel, and have Ctrl-C work correctly # to kill both at the same time. For more details, see: # https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script -(trap 'kill 0' SIGINT; create_initial_user & CODERV2_HOST=http://127.0.0.1:3000 yarn dev & ./bin/coderd) \ No newline at end of file +( + trap 'kill 0' SIGINT + create_initial_user & + CODERV2_HOST=http://127.0.0.1:3000 yarn --cwd=./site dev & + ./bin/coderd +) diff --git a/site/dev.ts b/site/dev.ts index 97aef1e720..19a39f58d5 100644 --- a/site/dev.ts +++ b/site/dev.ts @@ -17,7 +17,7 @@ if (process.env.CODERV2_HOST) { console.log(`Using CODERV2_HOST: ${coderV2Host}`) -const app = next({ dev, dir: "./site" }) +const app = next({ dev, dir: "." }) const handle = app.getRequestHandler() app