about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorLily Foster <lily@lily.flowers>2023-12-06 10:43:20 -0500
committerMatthieu Coudron <886074+teto@users.noreply.github.com>2023-12-24 22:58:32 +0100
commit8999c9d930c526d9f8e8761847e5ee939744590d (patch)
treef61d5be7a74f69ba65a3ba583b161e22b61ad41a /pkgs/build-support
parentfdbdb2d282c587f4eadf56d440924bc685a2e79e (diff)
downloadnixlib-8999c9d930c526d9f8e8761847e5ee939744590d.tar
nixlib-8999c9d930c526d9f8e8761847e5ee939744590d.tar.gz
nixlib-8999c9d930c526d9f8e8761847e5ee939744590d.tar.bz2
nixlib-8999c9d930c526d9f8e8761847e5ee939744590d.tar.lz
nixlib-8999c9d930c526d9f8e8761847e5ee939744590d.tar.xz
nixlib-8999c9d930c526d9f8e8761847e5ee939744590d.tar.zst
nixlib-8999c9d930c526d9f8e8761847e5ee939744590d.zip
npmHooks.npmInstallHook: ignore rather than error for missing bin/man keys in package.json
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
index 1e446bb1b051..56e3a883b99a 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
@@ -30,12 +30,14 @@ npmInstallHook() {
     done < <(@jq@ --raw-output '(.bin | type) as $typ | if $typ == "string" then
         .name + " " + .bin
         elif $typ == "object" then .bin | to_entries | map(.key + " " + .value) | join("\n")
+        elif $typ == "null" then empty
         else "invalid type " + $typ | halt_error end' "${npmWorkspace-.}/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' "${npmWorkspace-.}/package.json")
 
     local -r nodeModulesPath="$packageOut/node_modules"