mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
278e1bfb89
This follows in this example of npmConfigHook and allows for using this hook alongside others that may override configurePhase
36 lines
918 B
Bash
36 lines
918 B
Bash
yarnConfigHook(){
|
|
echo "Executing yarnConfigHook"
|
|
|
|
# Use a constant HOME directory
|
|
mkdir -p /tmp/home
|
|
export HOME=/tmp/home
|
|
if [[ -n "$yarnOfflineCache" ]]; then
|
|
offlineCache="$yarnOfflineCache"
|
|
fi
|
|
if [[ -z "$offlineCache" ]]; then
|
|
echo yarnConfigHook: No yarnOfflineCache or offlineCache were defined\! >&2
|
|
exit 2
|
|
fi
|
|
yarn config --offline set yarn-offline-mirror "$offlineCache"
|
|
fixup-yarn-lock yarn.lock
|
|
yarn install \
|
|
--frozen-lockfile \
|
|
--force \
|
|
--production=false \
|
|
--ignore-engines \
|
|
--ignore-platform \
|
|
--ignore-scripts \
|
|
--no-progress \
|
|
--non-interactive \
|
|
--offline
|
|
|
|
# TODO: Check if this is really needed
|
|
patchShebangs node_modules
|
|
|
|
echo "finished yarnConfigHook"
|
|
}
|
|
|
|
if [[ -z "${dontYarnInstallDeps-}" ]]; then
|
|
postConfigureHooks+=(yarnConfigHook)
|
|
fi
|