Files
karma/scripts/prune-go-cache.sh
2020-04-15 09:39:28 +01:00

17 lines
341 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit
set -o pipefail
DRY_RUN="$1"
GOCACHE=$(go env GOCACHE)
SIZE=`du -sxm ${GOCACHE} | awk '{print $1}'`
echo "GOCACHE size: ${SIZE}MB"
if [ "${DRY_RUN}" == "" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ $SIZE -gt 3500 ]; then
echo "Pruning GOCACHE at ${GOCACHE}"
find "${GOCACHE}" -type f -delete
fi