Merge pull request #184 from ronivay/feat/yarn-cache-cleanup
feat: add automatic yarn cache cleanup with a config option
This commit is contained in:
@@ -58,6 +58,11 @@ PLUGINS="all"
|
|||||||
# options: true/false
|
# options: true/false
|
||||||
AUTOUPDATE="true"
|
AUTOUPDATE="true"
|
||||||
|
|
||||||
|
# yarn cache can consume a lot of disk space over time. Setting this to true will clear cache after update.
|
||||||
|
# this can have a negative impact on how long update will take with slower internet connections
|
||||||
|
# options: true/false
|
||||||
|
#YARN_CACHE_CLEANUP="false"
|
||||||
|
|
||||||
# enable/disable OS check. Installation refuses to run on any other than supported OS versions if this is enabled. Can be disabled for experimental purposes.
|
# enable/disable OS check. Installation refuses to run on any other than supported OS versions if this is enabled. Can be disabled for experimental purposes.
|
||||||
# options: true/false
|
# options: true/false
|
||||||
OS_CHECK="true"
|
OS_CHECK="true"
|
||||||
|
@@ -48,6 +48,7 @@ USESUDO="${USESUDO:-"false"}"
|
|||||||
GENSUDO="${GENSUDO:-"false"}"
|
GENSUDO="${GENSUDO:-"false"}"
|
||||||
INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
|
INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
|
||||||
SYSLOG_TARGET="${SYSLOG_TARGET:-""}"
|
SYSLOG_TARGET="${SYSLOG_TARGET:-""}"
|
||||||
|
YARN_CACHE_CLEANUP="${YARN_CACHE_CLEANUP:-"false"}"
|
||||||
|
|
||||||
# set variables not changeable in configfile
|
# set variables not changeable in configfile
|
||||||
TIME=$(date +%Y%m%d%H%M)
|
TIME=$(date +%Y%m%d%H%M)
|
||||||
@@ -949,6 +950,14 @@ function UpdateXO {
|
|||||||
done
|
done
|
||||||
printok "Removing old inactive installations after update. Leaving $PRESERVE latest"
|
printok "Removing old inactive installations after update. Leaving $PRESERVE latest"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
# clear yarn cache if defined in configuration
|
||||||
|
if [[ "$YARN_CACHE_CLEANUP" == "true" ]]; then
|
||||||
|
printprog "Cleaning yarn cache"
|
||||||
|
runcmd "yarn cache clean"
|
||||||
|
printok "Cleaning yarn cache"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function InstallXOProxy {
|
function InstallXOProxy {
|
||||||
|
Reference in New Issue
Block a user