-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
.envrc
36 lines (28 loc) · 908 Bytes
/
.envrc
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
# hide warnings from direnv
# see https://github.com/direnv/direnv/issues/419#issuecomment-442005962
# see: https://direnv.net/man/direnv.toml.1.html#codewarntimeoutcode
export DIRENV_WARN_TIMEOUT=876000h # 100 years in hours
# if using nixos, run `use flake`
if has nix; then
use flake
else
# Check if nvm is installed, install if not
if [ ! -d "$NVM_DIR" ] || [ ! -s "$NVM_DIR/nvm.sh" ]; then
echo "nvm is not installed. Installing nvm..."
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
fi
# ensure nvm is in the path
export NVM_DIR="$HOME/.nvm"
export PATH="$NVM_DIR:$PATH"
# load nvm
\. $NVM_DIR/nvm.sh
# install node version from .nvmrc
nvm install
# enable pnpm in corepack
corepack enable pnpm
# install package manager with corepack (from package.json#packageManager)
corepack install
fi
# install dependencies
pnpm install