mirror of
https://github.com/kopia/kopia.git
synced 2026-07-29 14:56:57 -04:00
cli: don't ask for password if repository is not connected (#627)
This commit is contained in:
@@ -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