Commit 9aab65f3 authored by Martin Bark's avatar Martin Bark Committed by Thomas Petazzoni
Browse files

package/nodejs: symlink /usr/lib/node_modules/.bin/* to /usr/bin



This patch symlinks all executables in /usr/lib/node_modules/.bin
to /usr/bin so that node.js modules installed using
BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL are accessible from the command line.

Signed-off-by: default avatarMartin Bark <martin@barkynet.com>
Reviewed-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 73f3b45e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -111,6 +111,14 @@ define NODEJS_INSTALL_MODULES
		$(HOST_DIR)/usr/bin/npm install \
		$(NODEJS_MODULES_LIST) \
	)

	# Symlink all executables in $(TARGET_DIR)/usr/lib/node_modules/.bin to
	# $(TARGET_DIR)/usr/bin so they are accessible from the command line
	cd $(TARGET_DIR)/usr/bin; \
	for f in ../../usr/lib/node_modules/.bin/*; do \
		[ -f "$${f}" -a -x "$${f}" ] || continue; \
		ln -sf "$${f}" "$${f##*/}" || exit 1; \
	done
endef
endif