moved node.js install scripts to a single script as the armhf patch isn't needed anymore. improve the script.
parent
c0d968bc8d
commit
b35149d663
@ -1,33 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
|
|
||||||
|
|
||||||
function error {
|
|
||||||
echo -e "\\e[91m$1\\e[39m"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
#Checking if using armv6
|
|
||||||
if [ ! -z "$(cat /proc/cpuinfo | grep ARMv6)" ];then
|
|
||||||
error "armv6 cpu not supported"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v curl >/dev/null ; then
|
|
||||||
echo -e "\033[0;31mcurl: command not found.\e[39m
|
|
||||||
You need to install curl first. If you are on a debian system, this command should install it:
|
|
||||||
\e[4msudo apt install curl\e[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Install nvm manager:
|
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash || error "Failed to install nvm!"
|
|
||||||
export NVM_DIR="$HOME/.nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
||||||
|
|
||||||
#patch nvm script to forcibly use armhf
|
|
||||||
sed -i 's/^ nvm_echo "${NVM_ARCH}"/ NVM_ARCH=armv7l ; nvm_echo "${NVM_ARCH}"/g' "$NVM_DIR/nvm.sh"
|
|
||||||
|
|
||||||
#Install NodeJS:
|
|
||||||
nvm install --lts
|
|
||||||
#sudo npm i -g nodejs
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
|
|
||||||
|
|
||||||
function error {
|
|
||||||
echo -e "\\e[91m$1\\e[39m"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
#Checking if using armv6
|
|
||||||
if [ ! -z "$(cat /proc/cpuinfo | grep ARMv6)" ];then
|
|
||||||
error "armv6 cpu not supported"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v curl >/dev/null ; then
|
|
||||||
echo -e "\033[0;31mcurl: command not found.\e[39m
|
|
||||||
You need to install curl first. If you are on a debian system, this command should install it:
|
|
||||||
\e[4msudo apt install curl\e[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Install nvm manager:
|
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash || error "Failed to install nvm!"
|
|
||||||
export NVM_DIR="$HOME/.config/nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
||||||
|
|
||||||
#Install NodeJS:
|
|
||||||
nvm install --lts
|
|
||||||
#sudo npm i -g nodejs
|
|
Loading…
Reference in New Issue