@@ -26,22 +26,19 @@ function update_script() {
2626 msg_error " No ${APP} Installation Found!"
2727 exit
2828 fi
29- if command -v node > /dev/null; then
30- NODE_MAJOR=$( /usr/bin/env node -v | grep -oP ' ^v\K[0-9]+' )
31- if [[ " $NODE_MAJOR " != " 22" ]]; then
32- $STD apt-get purge -y nodejs
33- rm -f /etc/apt/sources.list.d/nodesource.list
34- rm -f /etc/apt/keyrings/nodesource.gpg
35- else
36- return
37- fi
29+ if ! command -v node > /dev/null || [[ " $( /usr/bin/env node -v | grep -oP ' ^v\K[0-9]+' ) " != " 22" ]]; then
30+ msg_info " Installing Node.js 22"
31+ $STD apt-get purge -y nodejs
32+ rm -f /etc/apt/sources.list.d/nodesource.list
33+ rm -f /etc/apt/keyrings/nodesource.gpg
34+ mkdir -p /etc/apt/keyrings
35+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
36+ 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
37+ $STD apt-get update
38+ $STD apt-get install -y nodejs
39+ $STD npm install -g
[email protected] 40+ msg_ok " Node.js 22 installed"
3841 fi
39- mkdir -p /etc/apt/keyrings
40- curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
41- 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
42- $STD apt-get update
43- $STD apt-get install -y nodejs
44- $STD npm install -g
[email protected] 4542 export NODE_OPTIONS=" --max_old_space_size=4096"
4643 RELEASE=$( curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
4744 if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
0 commit comments