Skip to content

Commit

Permalink
minor: prevent find running for quarterly cleanup if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach authored and nrmancuso committed Nov 13, 2022
1 parent 87cdbdc commit 7671fff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .ci/jsoref-spellchecker/whitelist.words
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,14 @@ detailastimpl
detailnodetreestringprinter
devops
Dexec
Dexpression
dfa
DFFF
Dfile
dfn
Dfoo
Dforbiddenapis
Dforce
Dgpg
Dhttp
Diachenko
Expand Down
11 changes: 10 additions & 1 deletion .ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ case $1 in

init-m2-repo)
if [[ $RUN_JOB == 1 ]]; then
MVN_REPO=$(mvn -e --no-transfer-progress help:evaluate -Dexpression=settings.localRepository \
-q -DforceStdout);
echo "Maven Repo Located At: " "$MVN_REPO"
MVN_SETTINGS=${TRAVIS_HOME}/.m2/settings.xml
if [[ -f ${MVN_SETTINGS} ]]; then
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
Expand Down Expand Up @@ -139,7 +142,13 @@ jacoco)
;;

quarterly-cache-cleanup)
find ~/.m2 -maxdepth 4 -type d -mtime +90 -exec rm -rf {} \;
MVN_REPO=$(mvn -e --no-transfer-progress help:evaluate -Dexpression=settings.localRepository \
-q -DforceStdout);
if [[ -d ${MVN_REPO} ]]; then
find "$MVN_REPO" -maxdepth 4 -type d -mtime +90 -exec rm -rf {} \;
else
echo "Failed to find correct maven cache to clean. Quietly exiting."
fi
;;

*)
Expand Down

0 comments on commit 7671fff

Please sign in to comment.