Simpify cmd_backup and cmd_init now we have the password in gopts.

This commit is contained in:
Pauline Middelink
2017-07-24 23:32:55 +02:00
parent d5615a67c8
commit c95e2b009e
3 changed files with 11 additions and 15 deletions
+5 -7
View File
@@ -34,13 +34,11 @@ func runInit(gopts GlobalOptions, args []string) error {
return errors.Fatalf("create backend at %s failed: %v\n", gopts.Repo, err)
}
if gopts.password == "" {
gopts.password, err = ReadPasswordTwice(gopts,
"enter password for new backend: ",
"enter password again: ")
if err != nil {
return err
}
gopts.password, err = ReadPasswordTwice(gopts,
"enter password for new backend: ",
"enter password again: ")
if err != nil {
return err
}
s := repository.New(be)