catch missing database file when running 'test' instead of crashing
This commit is contained in:
parent
e5f737b09d
commit
a6e1bb9b4c
@ -94,7 +94,11 @@ def run(verbosity=1, test=False, follow_links=False, commit_interval=300,
|
|||||||
chunk_size=DEFAULT_CHUNK_SIZE):
|
chunk_size=DEFAULT_CHUNK_SIZE):
|
||||||
current_dir = b'.' # sic, relative path
|
current_dir = b'.' # sic, relative path
|
||||||
bitrot_db = os.path.join(current_dir, b'.bitrot.db')
|
bitrot_db = os.path.join(current_dir, b'.bitrot.db')
|
||||||
conn = get_sqlite3_cursor(bitrot_db, copy=test)
|
try:
|
||||||
|
conn = get_sqlite3_cursor(bitrot_db, copy=test)
|
||||||
|
except ValueError:
|
||||||
|
print('No database exists so cannot test. Run the tool once first.')
|
||||||
|
sys.exit(2)
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
new_paths = []
|
new_paths = []
|
||||||
updated_paths = []
|
updated_paths = []
|
||||||
|
Reference in New Issue
Block a user