mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-04-20 00:25:12 +00:00
Tianji: Bump NodeJS to V22 (#3519)
* Tianji: Bump to NodeJS 22 * NodeJS check & update
This commit is contained in:
parent
e35416eb7f
commit
3abb4b0060
16
ct/tianji.sh
16
ct/tianji.sh
@ -26,6 +26,22 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if command -v node >/dev/null; then
|
||||
NODE_MAJOR=$(/usr/bin/env node -v | grep -oP '^v\K[0-9]+')
|
||||
if [[ "$NODE_MAJOR" != "22" ]]; then
|
||||
$STD apt-get purge -y nodejs
|
||||
rm -f /etc/apt/sources.list.d/nodesource.list
|
||||
rm -f /etc/apt/keyrings/nodesource.gpg
|
||||
else
|
||||
return
|
||||
fi
|
||||
fi
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
$STD npm install -g pnpm@9.7.1
|
||||
RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Stopping ${APP} Service"
|
||||
|
@ -30,7 +30,7 @@ msg_ok "Installed Dependencies"
|
||||
msg_info "Installing Node.js"
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
$STD npm install -g pnpm@9.7.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user