mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 10:53:11 +00:00
15 lines
510 B
Bash
15 lines
510 B
Bash
# shellcheck shell=bash
|
|
|
|
nodejsInstallManuals() {
|
|
local -r packageJson="${1-./package.json}"
|
|
|
|
local -r packageOut="$out/lib/node_modules/$(@jq@ --raw-output '.name' package.json)"
|
|
|
|
while IFS= read -r man; do
|
|
installManPage "$packageOut/$man"
|
|
done < <(@jq@ --raw-output '(.man | type) as $typ | if $typ == "string" then .man
|
|
elif $typ == "list" then .man | join("\n")
|
|
elif $typ == "null" then empty
|
|
else "invalid type " + $typ | halt_error end' "$packageJson")
|
|
}
|