Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1# shellcheck shell=bash 2 3nodejsInstallManuals() { 4 local -r packageJson="${1-./package.json}" 5 6 local -r packageOut="$out/lib/node_modules/$(@jq@ --raw-output '.name' package.json)" 7 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") 14}