logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git
commit: 874677786cbbe1472c690c81858be093c29c1fb1
parent f53b5d574e62997ac242881232769041966a1c10
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 16 Sep 2023 07:39:11 +0200

nodejs.eclass: Handle main entry lacking .js extension

Diffstat:

Meclass/nodejs.eclass7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/nodejs.eclass b/eclass/nodejs.eclass @@ -79,7 +79,12 @@ nodejs_src_install() { if jq -e 'has("main")' <package.json >/dev/null then - doins "$(jq -r -e '.main' <package.json)" + main="$(jq -r -e '.main' <package.json)" + if test -e "${main}"; then + doins "${main}" + else + doins "${main}.js" + fi else test -e index.js && doins index.js fi