Update NodeJS and Yarn packages before running xo update. Prevent issue where install fails because of outdated package
This commit is contained in:
@@ -26,6 +26,8 @@ LOGFILE="$(dirname $0)/xo-install.log"
|
|||||||
# comma separated list of plugins to be installed, check README for more information
|
# comma separated list of plugins to be installed, check README for more information
|
||||||
#PLUGINS="xo-server-transport-email,xo-server-usage-report,xo-server-perf-alert"
|
#PLUGINS="xo-server-transport-email,xo-server-usage-report,xo-server-perf-alert"
|
||||||
|
|
||||||
|
# NodeJS and Yarn are automatically updated when running update. Switch this option to false if you want to disable it.
|
||||||
|
AUTOUPDATE="true"
|
||||||
|
|
||||||
### End of editable variables ###
|
### End of editable variables ###
|
||||||
|
|
||||||
@@ -141,6 +143,23 @@ function InstallDependenciesDebian {
|
|||||||
|
|
||||||
} 2>$LOGFILE
|
} 2>$LOGFILE
|
||||||
|
|
||||||
|
function UpdateNodeYarn {
|
||||||
|
|
||||||
|
if [[ $AUTOUPDATE == "true" ]]; then
|
||||||
|
|
||||||
|
if [ $OSNAME == "CentOS" ]; then
|
||||||
|
echo
|
||||||
|
echo "Checking updates for nodejs and yarn"
|
||||||
|
yum update -y nodejs yarn > /dev/null
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "Checking updates for nodejs and yarn"
|
||||||
|
apt-get update -y nodejs yarn > /dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
} 2>$LOGFILE
|
||||||
|
|
||||||
function InstallXOPlugins {
|
function InstallXOPlugins {
|
||||||
if [[ "$PLUGINS" ]] && [[ ! -z "$PLUGINS" ]]; then
|
if [[ "$PLUGINS" ]] && [[ ! -z "$PLUGINS" ]]; then
|
||||||
|
|
||||||
@@ -319,6 +338,7 @@ function UpdateXOAutomate {
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--update)
|
--update)
|
||||||
|
UpdateNodeYarn
|
||||||
UpdateXO
|
UpdateXO
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -442,6 +462,7 @@ read -p ": " option
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
|
UpdateNodeYarn
|
||||||
UpdateXO
|
UpdateXO
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user