evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / no / nodejsInstallManuals / hook.sh
blobf0ff209c6226495a596a62f289dd88528cdc39dd
1 # shellcheck shell=bash
3 nodejsInstallManuals() {
4 local -r packageJson="${1-./package.json}"
6 local -r packageOut="$out/lib/node_modules/$(@jq@ --raw-output '.name' package.json)"
8 while IFS= read -r man; do
9 installManPage "$packageOut/$man"
10 done < <(@jq@ --raw-output '(.man | type) as $typ | if $typ == "string" then .man
11 elif $typ == "list" then .man | join("\n")
12 elif $typ == "null" then empty
13 else "invalid type " + $typ | halt_error end' "$packageJson")