nixos/ebusd: fix device access (#352743)
[NixPkgs.git] / pkgs / build-support / node / fetch-yarn-deps / yarn-config-hook.sh
blob7d8c70d270082be21d7ad73b3205a40f9a0712d5
1 yarnConfigHook(){
2 echo "Executing yarnConfigHook"
4 # Use a constant HOME directory
5 mkdir -p /tmp/home
6 export HOME=/tmp/home
7 if [[ -n "$yarnOfflineCache" ]]; then
8 offlineCache="$yarnOfflineCache"
9 fi
10 if [[ -z "$offlineCache" ]]; then
11 echo yarnConfigHook: No yarnOfflineCache or offlineCache were defined\! >&2
12 exit 2
14 yarn config --offline set yarn-offline-mirror "$offlineCache"
15 fixup-yarn-lock yarn.lock
16 yarn install \
17 --frozen-lockfile \
18 --force \
19 --production=false \
20 --ignore-engines \
21 --ignore-platform \
22 --ignore-scripts \
23 --no-progress \
24 --non-interactive \
25 --offline
27 # TODO: Check if this is really needed
28 patchShebangs node_modules
30 echo "finished yarnConfigHook"
33 if [[ -z "${dontYarnInstallDeps-}" ]]; then
34 postConfigureHooks+=(yarnConfigHook)