cleanup once a month

This commit is contained in:
radius 2015-11-01 12:34:23 -05:00
parent 468bc4e32a
commit 43b81a8dad

View File

@ -190,9 +190,12 @@ if [ -z "$FORCE" ]; then
FORCE=NO
fi
# set cleanup to NO by default
DAY=`date '+%d'`
if [ $DAY == 01 ]; then
FORCE=YES
CLEANUP=YES
fi
# set force_retroarch_build to NO if not specified
@ -806,7 +809,12 @@ while read line; do
# repo is a regular repository
if [ "${TYPE}" = "PROJECT" ]; then
if [ -d "${DIR}/.git" ]; then
if [ "${CLEANUP}" == "YES" ]; then
rm -rfv $DIR
echo "cloning repo..."
git clone --depth=1 "$URL" "$DIR"
BUILD="YES"
else
cd $DIR
echo "pulling from repo... "
OUT=`git pull`
@ -817,6 +825,8 @@ while read line; do
BUILD="YES"
fi
fi
OLDFORCE=$FORCE
OLDBUILD=$BUILD