From 28319492961b710ec04ccf54dff355c955a2f413 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 15 May 2017 21:37:06 -0600 Subject: [PATCH] use NODE_PATH for node_install_path --- setup-min.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup-min.sh b/setup-min.sh index 6880c16..3f8b44f 100644 --- a/setup-min.sh +++ b/setup-min.sh @@ -12,6 +12,12 @@ # curl -fsSL https://example.com/setup-min.bash | bash # wget -nv https://example.com/setup-min.bash -O - | bash +if [ -z "$NODE_PATH" ]; then + node_install_path=$(dirname $(dirname $NODE_PATH)) +else + node_install_path=$PREFIX/usr/local +fi + NODEJS_NAME="node" NODEJS_BASE_URL="https://nodejs.org" BASE_URL="https://git.daplie.com/coolaj86/node-install-script/raw/master" @@ -233,6 +239,6 @@ if [ -n "${NODEJS_VER}" ]; then bash "/tmp/${INSTALL_FILE}" "${NODEJS_VER}" fi -sudo chown -R $(whoami):$(whoami) /usr/local/lib/node_modules +sudo chown -R $(whoami):$(whoami) $node_install_path/lib/node_modules echo "" \ No newline at end of file