-
Notifications
You must be signed in to change notification settings - Fork 3
/
.envrc
26 lines (18 loc) · 1.03 KB
/
.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
#SPDX-FileCopyrightText: 2017-2024 Enedis
#SPDX-License-Identifier: Apache-2.0
# Setup a working environment without hassle using nix and direnv
# For more information, visit https://direnv.net/
# Install node, npm and geckodriver by loading .env.chutney.nix expression
use_nix .env.chutney.nix
# Some tools (ex. Intellij) might need to configure paths to node, npm etc.
# You can use following symlinks provided in .env folder
## Create .env folder
[[ ! -d .env.chutney ]] && mkdir .env.chutney && echo "Create .env.chutney folder"
## Symlink npm home
ln -sfn $(dirname "$(dirname "$(readlink -f $(which npm))")") .env.chutney/npm_home && echo "Symlink npm home dir"
## Symlink JDK
ln -sfn $JAVA_HOME .env.chutney/jdk && echo "Symlink jdk \"$JAVA_HOME\""
## Symlink Node
ln -sfn $(readlink -f $(which node)) .env.chutney/node && echo "Symlink node \"$(readlink -f $(which node))"
# Run npm install if needed
[[ ! -d ./chutney/ui/node_modules ]] && echo "node_modules not found. Starting npm install" && cd ./chutney/ui && npm install && cd -