From 0e7cf61888257d18a0f3b1efbd0adf2125cc048d Mon Sep 17 00:00:00 2001 From: Phi-rjan Date: Thu, 9 Feb 2023 16:50:15 +0100 Subject: [PATCH] Update cli/backup.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ɓukasz Magiera --- cli/backup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/backup.go b/cli/backup.go index e939ec0df..d2d8f25ff 100644 --- a/cli/backup.go +++ b/cli/backup.go @@ -92,7 +92,7 @@ func BackupCmd(repoFlag string, rt repo.RepoType, getApi BackupApiFn) *cli.Comma defer closer() backupPath := cctx.Args().First() - if _, err := os.Stat(backupPath); err == nil { + if _, err := os.Stat(backupPath); !os.IsNotExist(err) { return xerrors.Errorf("backup file %s already exists. Overwriting it will corrupt the file, please specify another file name", backupPath) }