Update tools.func

This commit is contained in:
CanbiZ 2025-05-14 13:57:35 +02:00
parent 1285c4b3bd
commit 3f20620006

View File

@ -9,13 +9,13 @@ install_node_and_modules() {
if command -v node >/dev/null; then if command -v node >/dev/null; then
CURRENT_NODE_VERSION="$(node -v | grep -oP '^v\K[0-9]+')" CURRENT_NODE_VERSION="$(node -v | grep -oP '^v\K[0-9]+')"
if [[ "$CURRENT_NODE_VERSION" != "$NODE_VERSION" ]]; then if [[ "$CURRENT_NODE_VERSION" != "$NODE_VERSION" ]]; then
msg_info "Node.js version $CURRENT_NODE_VERSION found, replacing with $NODE_VERSION" $STD msg_info "Node.js version $CURRENT_NODE_VERSION found, replacing with $NODE_VERSION"
NEED_NODE_INSTALL=true NEED_NODE_INSTALL=true
else else
msg_ok "Node.js $NODE_VERSION already installed" $STD msg_ok "Node.js $NODE_VERSION already installed"
fi fi
else else
msg_info "Node.js not found, installing version $NODE_VERSION" msg_info "Setup Node.js $NODE_VERSION"
NEED_NODE_INSTALL=true NEED_NODE_INSTALL=true
fi fi
@ -45,7 +45,7 @@ install_node_and_modules() {
exit 1 exit 1
fi fi
msg_ok "Installed Node.js ${NODE_VERSION}" msg_ok "Setup Node.js ${NODE_VERSION}"
fi fi
export NODE_OPTIONS="--max-old-space-size=4096" export NODE_OPTIONS="--max-old-space-size=4096"