Only print cache warning for terminals

This commit is contained in:
Alexander Neumann 2017-12-13 19:57:05 +01:00
parent d3ebe1311f
commit 2f26fb8834
1 changed files with 4 additions and 2 deletions

View File

@ -388,8 +388,10 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
}
}
} else {
Verbosef("found %d old cache directories in %v, pass --cleanup-cache to remove them\n",
len(oldCacheDirs), c.Base)
if stdoutIsTerminal() {
Verbosef("found %d old cache directories in %v, pass --cleanup-cache to remove them\n",
len(oldCacheDirs), c.Base)
}
}
return s, nil