Просмотр исходного кода

SCRIPT DEPRECATION WARNING Node JS install script

You don't want to wait 60 sec
Jaap Marcus 2 лет назад
Родитель
Сommit
1ce892d666
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      bin/v-update-sys-hestia-git

+ 5 - 2
bin/v-update-sys-hestia-git

@@ -21,7 +21,7 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 # define NodeJS version for download (required for building JS/CSS)
-nodejs_ver="20"
+NODE_MAJOR=20
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
@@ -30,7 +30,10 @@ check_hestia_demo_mode
 if [ -z $(which "node") ]; then
 	read -p "NodeJS not found. Install now to proceed? [Y/n] " answer
 	if [ "$answer" = 'y' ] || [ "$answer" = 'Y' ]; then
-		curl -fsSL "https://deb.nodesource.com/setup_$nodejs_ver.x" | bash - &&\
+		sudo mkdir -p /etc/apt/keyrings
+		curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+
+		echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
 		sudo apt-get install -y nodejs
 	else
 		exit 0