mirror of
https://github.com/kopia/kopia.git
synced 2026-10-21 21:54:41 -04:00
cli: don't ask for password if repository is not connected (#627)
This commit is contained in:
1 parent
fce9497375
commit
538c644586
1 file changed
+6
-2
+6
-2
@@ -47,8 +47,12 @@ func onCtrlC(f func()) {
|
||||
}
|
||||
|
||||
func openRepository(ctx context.Context, opts *repo.Options, required bool) (repo.Repository, error) {
|
||||
if _, err := os.Stat(repositoryConfigFileName()); os.IsNotExist(err) && !required {
|
||||
return nil, nil
|
||||
if _, err := os.Stat(repositoryConfigFileName()); os.IsNotExist(err) {
|
||||
if !required {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return nil, errors.Errorf("repository is not connected. See https://kopia.io/docs/repositories/")
|
||||
}
|
||||
|
||||
maybePrintUpdateNotification(ctx)
|
||||
|
||||
Reference in new issue
Block a user