File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
SOURCE=${BASH_SOURCE[0]}
4
- test -L " $SOURCE " && SOURCE=$( readlink " $SOURCE " )
4
+ test -L " $SOURCE " && command cd " $( dirname " $SOURCE " ) " && \
5
+ SOURCE=$( readlink " $SOURCE " )
5
6
DIR=" $( command cd " $( dirname " $SOURCE " ) " && pwd ) "
6
7
7
8
# shellcheck disable=SC1090
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -ex
4
+
5
+ die () { echo " $@ " ; exit 1; }
6
+
7
+ INSTPATH=" $( mktemp -p " $( pwd) " -d) "
8
+ trap ' test ! -z "${INSTPATH-}" && test -d "$INSTPATH" && rm -rf "$INSTPATH"' EXIT
9
+ declare -x NVM_DIR=$INSTPATH
10
+ \. ../../../nvm.sh
11
+
12
+ nvm install --lts || die ' nvm install --lts failed'
13
+ nvm exec --lts npm --version || die " ` nvm exec` failed to run"
14
+ declare -x NODE_VERSION=" $( nvm exec --lts --silent node --version) "
15
+
16
+ ln -s ../../../../nvm-exec " $INSTPATH /nvm-exec" || die " failed to create a symlink to $INSTPATH /"
17
+ " $INSTPATH /nvm-exec" npm ls > /dev/null || die " ` nvm exec` failed to run using nvm-exec helper"
You can’t perform that action at this time.
0 commit comments