forked from TrueCloudLab/restic
Display 'created new cache in ' message only if output is terminal
This commit is contained in:
parent
88a23521dd
commit
5592c17e4a
2 changed files with 10 additions and 1 deletions
9
changelog/unreleased/issue-3334
Normal file
9
changelog/unreleased/issue-3334
Normal 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
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue