mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 17:27:31 +00:00
Emit user-friendly error if repo key is exported to a directory (fixes #4348)
This commit is contained in:
parent
ce69fc1e19
commit
72ebd13e6f
1 changed files with 8 additions and 4 deletions
|
@ -325,10 +325,14 @@ def do_key_export(self, args, repository):
|
||||||
if not args.path:
|
if not args.path:
|
||||||
self.print_error("output file to export key to expected")
|
self.print_error("output file to export key to expected")
|
||||||
return EXIT_ERROR
|
return EXIT_ERROR
|
||||||
if args.qr:
|
try:
|
||||||
manager.export_qr(args.path)
|
if args.qr:
|
||||||
else:
|
manager.export_qr(args.path)
|
||||||
manager.export(args.path)
|
else:
|
||||||
|
manager.export(args.path)
|
||||||
|
except IsADirectoryError:
|
||||||
|
self.print_error("'{}' must be a file, not a directory".format(args.path))
|
||||||
|
return EXIT_ERROR
|
||||||
return EXIT_SUCCESS
|
return EXIT_SUCCESS
|
||||||
|
|
||||||
@with_repository(lock=False, exclusive=False, manifest=False, cache=False)
|
@with_repository(lock=False, exclusive=False, manifest=False, cache=False)
|
||||||
|
|
Loading…
Reference in a new issue