From dd01e7448f5aaa83fc47549056991274940ff9b4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Apr 2014 07:43:30 +0530 Subject: [PATCH] calibredb check_library: Do not create empty library if user specifies incorrect path --- src/calibre/library/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index c3509f5a23..7544d8d745 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -1211,6 +1211,10 @@ def command_check_library(args, dbpath): for i in list: print ' %-40.40s - %-40.40s'%(i[0], i[1]) + if not LibraryDatabase.exists_at(dbpath): + prints('No library found at', dbpath, file=sys.stderr) + raise SystemExit(1) + db = LibraryDatabase(dbpath) checker = CheckLibrary(dbpath, db) checker.scan_library(names, exts)