Skip to content

Commit 8d6080a

Browse files
committed
feat: add daemon script node check
1 parent 12cb0e3 commit 8d6080a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

daemon/setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ Red_Error() {
4444
}
4545

4646
Install_Node() {
47+
if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then
48+
echo_green "Node.js version is up-to-date, skipping installation."
49+
return
50+
fi
51+
4752
echo_cyan_n "[+] Install Node.JS environment...\n"
4853

4954
rm -irf "$node_install_path"

daemon/setup_cn.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ Red_Error() {
4444
}
4545

4646
Install_Node() {
47+
if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then
48+
echo_green "Node.js version is up-to-date, skipping installation."
49+
return
50+
fi
51+
4752
echo_cyan_n "[+] 安装 Node.JS...\n"
4853

4954
rm -irf "$node_install_path"

0 commit comments

Comments
 (0)