-
Notifications
You must be signed in to change notification settings - Fork 2
/
start
executable file
·26 lines (21 loc) · 1.02 KB
/
start
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
#!/usr/bin/env bash
# Script to start the local dev server
set -e
# Unless the RunDevServer binary is available, we rebuild the .envrc cache with nix-shell
# and config cachix for using our binary cache
command -v RunDevServer >/dev/null 2>&1 \
|| { echo "PATH_add $(nix-shell -j auto --cores 0 --run 'printf %q $PATH')" > .envrc; }
# Now we have to load the PATH variable from the .envrc cache
direnv allow
eval "$(direnv hook bash)"
eval "$(direnv export bash)"
# On macOS the default max count of open files is 256. IHP needs atleast 1024 to run well.
#
# The wai-static-middleware sometimes doesn't close it's file handles directly (likely because of it's use of lazy bytestrings)
# and then we usually hit the file limit of 256 at some point. With 1024 the limit is usually never hit as the GC kicks in earlier
# and will close the remaining lazy bytestring handles.
if [[ $OSTYPE == 'darwin'* ]]; then
ulimit -n 4096
fi
# Finally start the dev server
make tailwind-dev & IHP_BROWSER=echo IHP_EDITOR="code --goto" RunDevServer