From a30167280df54a11776f09f9e6e9d8a67ce404ae Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 23 Feb 2024 18:58:39 +0100 Subject: [PATCH] install npm 2 --- install.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index cd07228..d00a623 100644 --- a/install.sh +++ b/install.sh @@ -170,14 +170,12 @@ fi echo -e "${PURPLE}${BOLD}Install NPM ? (y/n) ${RESET}" read answer if [[ "$answer" == "y" ]]; then - if [ "$(whoami)" != "$username" ]; then - su - $username - fi - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - nvm install v18 + su - $username -c '\ +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash &&\ +export NVM_DIR="$HOME/.nvm" &&\ +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&\ +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" &&\ +nvm install v18' echo "ok pour npm"; fi