-
Notifications
You must be signed in to change notification settings - Fork 2
/
run
executable file
·36 lines (28 loc) · 999 Bytes
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -eu -o pipefail
# this is the entrypoint for development. It wraps up compiling and calling run.ts
# all arguments, changes, etc. should be found in src/run.ts
if ! which direnv > /dev/null ; then
echo "direnv not found on the system. See installation and setup instructions at https://direnv.net/"
exit 1
fi
# check node exists
if ! which node > /dev/null ; then
echo "node not found on the system. Install version in .nvmrc based on instructions in README"
exit 1
fi
# check node version
if ! diff <(cat .nvmrc | tr -d '\n') <(node -v | tr -d '\n') > /dev/null ; then
echo "node version does not match the version required in .nvmrc"
echo "If using nvm, run 'nvm use'"
exit 1
fi
# check bun exists
if ! which bun > /dev/null ; then
echo "bun not found on the system. On macOS, you can install it with 'brew install oven-sh/bun/bun'"
exit 1
fi
# Ensure packages are up to date.
bun install
# build and run dev.ts
bun build:cli && node ./.build_run/src/run.js "$@"