Merge pull request #3607 from jtagcat/quieter_cleanup

logging: quiet 'removing n old cache dirs'
This commit is contained in:
MichaelEischer 2021-12-29 16:06:35 +01:00 committed by GitHub
commit 8832837a8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -502,8 +502,9 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
// cleanup old cache dirs if instructed to do so
if opts.CleanupCache {
Printf("removing %d old cache dirs from %v\n", len(oldCacheDirs), c.Base)
if stdoutIsTerminal() && !opts.JSON {
Verbosef("removing %d old cache dirs from %v\n", len(oldCacheDirs), c.Base)
}
for _, item := range oldCacheDirs {
dir := filepath.Join(c.Base, item.Name())
err = fs.RemoveAll(dir)