Skip to content

Commit

Permalink
fix: Adjust ./develop.sh script to run in ./site (#142)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
bryphe-coder committed Feb 2, 2022
1 parent 2afad8b commit d76737b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
(
trap 'kill 0' SIGINT
create_initial_user &
CODERV2_HOST=http://127.0.0.1:3000 yarn --cwd=./site dev &
./bin/coderd
)
2 changes: 1 addition & 1 deletion site/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d76737b

Please sign in to comment.