From 0292a407182886aa33207af0b0f5d2a3176c0bb4 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 4 Mar 2015 15:51:25 -0800 Subject: [PATCH] setup.sh, npm test - Fix for debian.org's build of nodejs Debian renamed "node" to "nodejs" to avoid conflicts with another package. One can resolve that by installing an extra package ("nodejs-legacy") or by using the nodesource.com packages, but users may not know that. https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html This commit uses whichever command is available. --- bin/setup.sh | 4 ++++ tools/scripts/npm/test.sh | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/setup.sh b/bin/setup.sh index ab58b71625..d0ed915895 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -151,6 +151,10 @@ if [ -n "$DO_DOWNLOAD" ]; then fi BOWER=$(pickcmd node_modules/bower/bin/bower bower) + if [ -f "$BOWER" ]; then + NODE=$(pickcmd node nodejs) + BOWER="$NODE $BOWER" + fi # Without the force flag bower won't check for new versions or verify that installed software matches version specified in bower.json $BOWER install -f popd diff --git a/tools/scripts/npm/test.sh b/tools/scripts/npm/test.sh index 8cf25ba2a2..1a114feaae 100644 --- a/tools/scripts/npm/test.sh +++ b/tools/scripts/npm/test.sh @@ -1,6 +1,12 @@ #!/bin/bash if which node_modules/karma/bin/karma >> /dev/null; then - node node_modules/karma/bin/karma start + if which nodejs >> /dev/null; then + ## Debian + nodejs node_modules/karma/bin/karma start + else + ## Official + node node_modules/karma/bin/karma start + fi elif which karma >> /dev/null ; then karma start else -- 2.25.1