tidy up node update function

This commit is contained in:
ronivay
2021-05-03 14:58:18 +03:00
parent 3757cad406
commit 15cc82ff8a

View File

@@ -307,12 +307,15 @@ function InstallDependenciesDeb {
function UpdateNodeYarn {
if [[ $AUTOUPDATE == "true" ]]; then
if [[ $AUTOUPDATE != "true" ]]; then
return 0
fi
if [ $PKG_FORMAT == "rpm" ]; then
echo
printinfo "Checking current node.js version"
NODEV=$(node -v 2>/dev/null| grep -Eo '[0-9.]+' | cut -d'.' -f1)
if [ $PKG_FORMAT == "rpm" ]; then
if [[ -n $NODEV ]] && [[ $NODEV -lt ${NODEVERSION} ]]; then
echo
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
@@ -335,10 +338,9 @@ function UpdateNodeYarn {
printinfo "node.js version already on $NODEV"
fi
fi
else
echo
printinfo "Checking current node.js version"
NODEV=$(node -v 2>/dev/null| grep -Eo '[0-9.]+' | cut -d'.' -f1)
fi
if [ $PKG_FORMAT == "deb" ]]; then
if [[ -n $NODEV ]] && [[ $NODEV -lt ${NODEVERSION} ]]; then
echo
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
@@ -360,7 +362,6 @@ function UpdateNodeYarn {
fi
fi
fi
fi
}
function InstallXOPlugins {