Update cli/backup.go

Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
This commit is contained in:
Phi-rjan 2023-02-09 16:50:15 +01:00 committed by GitHub
parent b78cbcbb99
commit 0e7cf61888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}