Output password successful on terminal stdout

This removes the conditions that checks if the password is supplied
through environment variable or file and outputs password is successful
on terminal and when --quiet is not supplied.
This commit is contained in:
Anton Lindstrom 2017-10-04 14:55:04 +02:00
parent 55e6003749
commit a7baea0522
1 changed files with 1 additions and 15 deletions

View File

@ -132,20 +132,6 @@ func restoreTerminal() {
}) })
} }
// shouldOutputPasswordSuccessful returns true if the password is supplied
// interactively and the stdout is a terminal.
func shouldOutputPasswordSuccessful() bool {
if globalOptions.PasswordFile != "" {
return false
}
if os.Getenv("RESTIC_PASSWORD") != "" {
return false
}
return stdoutIsTerminal()
}
// ClearLine creates a platform dependent string to clear the current // ClearLine creates a platform dependent string to clear the current
// line, so it can be overwritten. ANSI sequences are not supported on // line, so it can be overwritten. ANSI sequences are not supported on
// current windows cmd shell. // current windows cmd shell.
@ -340,7 +326,7 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) {
return nil, err return nil, err
} }
if shouldOutputPasswordSuccessful() { if stdoutIsTerminal() {
Verbosef("password is correct\n") Verbosef("password is correct\n")
} }