2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 14:56:29 +00:00

Merge pull request #3343 from hluup/3334

Display 'created new cache in ' message only if output is terminal
This commit is contained in:
MichaelEischer 2021-03-27 12:43:37 +01:00 committed by GitHub
commit d456437ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,9 @@
Bugfix: Print `created new cache` message only on a terminal
`created new cache` message was outputed even when the output wasn't a
terminal. That broke piping `restic dump` output to tar or zip
if cache directory didn't exist. The message is now only printed on a
terminal.
https://github.com/restic/restic/issues/3334
https://github.com/restic/restic/pull/3343

View File

@ -492,7 +492,7 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
return s, nil
}
if c.Created && !opts.JSON {
if c.Created && !opts.JSON && stdoutIsTerminal() {
Verbosef("created new cache in %v\n", c.Base)
}