Files
karma/scripts/prune-go-cache.sh
2020-04-07 17:37:34 +01:00

15 lines
263 B
Bash
Executable File

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