summaryrefslogtreecommitdiffstats
path: root/package/nodejs
diff options
context:
space:
mode:
authorMartin Bark <martin@barkynet.com>2015-07-02 10:43:25 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-04 14:38:13 +0200
commit9aab65f304ed18ecb93d25de497e4f2fef75973d (patch)
tree806cbf80624a0e779420af2257179a7531dfc028 /package/nodejs
parent73f3b45e18a7b2a77c9ba97dbc2218bd68c0d52d (diff)
downloadbuildroot-9aab65f304ed18ecb93d25de497e4f2fef75973d.tar.gz
buildroot-9aab65f304ed18ecb93d25de497e4f2fef75973d.zip
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: Martin Bark <martin@barkynet.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/nodejs')
-rw-r--r--package/nodejs/nodejs.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index 59e03b0095..0b3f8a51c2 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -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
OpenPOWER on IntegriCloud