summaryrefslogtreecommitdiff
path: root/deps/npm/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/scripts')
-rwxr-xr-xdeps/npm/scripts/doc-build.sh52
-rwxr-xr-xdeps/npm/scripts/install.sh41
2 files changed, 6 insertions, 87 deletions
diff --git a/deps/npm/scripts/doc-build.sh b/deps/npm/scripts/doc-build.sh
index b951eb7d36..a37a5e2618 100755
--- a/deps/npm/scripts/doc-build.sh
+++ b/deps/npm/scripts/doc-build.sh
@@ -6,58 +6,6 @@ fi
set -o errexit
set -o pipefail
-if ! [ -x node_modules/.bin/marked-man ]; then
- ps=0
- if [ -f .building_marked-man ]; then
- pid=$(cat .building_marked-man)
- ps=$(ps -p $pid | grep $pid | wc -l) || true
- fi
-
- if [ -f .building_marked-man ] && [ $ps != 0 ]; then
- while [ -f .building_marked-man ]; do
- sleep 1
- done
- else
- # a race to see which make process will be the one to install marked-man
- echo $$ > .building_marked-man
- sleep 1
- if [ $(cat .building_marked-man) == $$ ]; then
- make node_modules/.bin/marked-man
- rm .building_marked-man
- else
- while [ -f .building_marked-man ]; do
- sleep 1
- done
- fi
- fi
-fi
-
-if ! [ -x node_modules/.bin/marked ]; then
- ps=0
- if [ -f .building_marked ]; then
- pid=$(cat .building_marked)
- ps=$(ps -p $pid | grep $pid | wc -l) || true
- fi
-
- if [ -f .building_marked ] && [ $ps != 0 ]; then
- while [ -f .building_marked ]; do
- sleep 1
- done
- else
- # a race to see which make process will be the one to install marked
- echo $$ > .building_marked
- sleep 1
- if [ $(cat .building_marked) == $$ ]; then
- make node_modules/.bin/marked
- rm .building_marked
- else
- while [ -f .building_marked ]; do
- sleep 1
- done
- fi
- fi
-fi
-
src=$1
dest=$2
name=$(basename ${src%.*})
diff --git a/deps/npm/scripts/install.sh b/deps/npm/scripts/install.sh
index 8ec16f95bb..041c74e0fe 100755
--- a/deps/npm/scripts/install.sh
+++ b/deps/npm/scripts/install.sh
@@ -53,6 +53,11 @@ export npm_config_loglevel
# make sure that node exists
node=`which node 2>&1`
ret=$?
+# if not found, try "nodejs" as it is the case on debian
+if [ $ret -ne 0 ]; then
+ node=`which nodejs 2>&1`
+ ret=$?
+fi
if [ $ret -eq 0 ] && [ -x "$node" ]; then
(exit 0)
else
@@ -203,41 +208,7 @@ cd "$TMP" \
&& curl -SsL "$url" \
| $tar -xzf - \
&& cd "$TMP"/* \
- && (ver=`"$node" bin/read-package-json.js package.json version`
- isnpm10=0
- if [ $ret -eq 0 ]; then
- if [ -d node_modules ]; then
- if "$node" node_modules/semver/bin/semver -v "$ver" -r "1"
- then
- isnpm10=1
- fi
- else
- if "$node" bin/semver -v "$ver" -r ">=1.0"; then
- isnpm10=1
- fi
- fi
- fi
-
- ret=0
- if [ $isnpm10 -eq 1 ] && [ -f "scripts/clean-old.sh" ]; then
- if [ "x$skipclean" = "x" ]; then
- (exit 0)
- else
- clean=no
- fi
- if [ "x$clean" = "xno" ] \
- || [ "x$clean" = "xn" ]; then
- echo "Skipping 0.x cruft clean" >&2
- ret=0
- elif [ "x$clean" = "xy" ] || [ "x$clean" = "xyes" ]; then
- NODE="$node" /bin/bash "scripts/clean-old.sh" "-y"
- ret=$?
- else
- NODE="$node" /bin/bash "scripts/clean-old.sh" </dev/tty
- ret=$?
- fi
- fi
-
+ && (ret=0
if [ $ret -ne 0 ]; then
echo "Aborted 0.x cleanup. Exiting." >&2
exit $ret