Skip to content

Commit 2e7eb9b

Browse files
authored
fix: create cache directory with offline import (#5436)
Allow the user to import his own cve.db file through --import cve.db by creating cachedir if it does not exist Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
1 parent af0ee6e commit 2e7eb9b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cve_bin_tool/cvedb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,8 @@ def copy_db(self, filename, export=True):
798798
if export:
799799
shutil.copy2(self.dbpath, filename)
800800
else:
801+
if not self.cachedir.is_dir():
802+
self.cachedir.mkdir(parents=True)
801803
shutil.copy2(filename, self.dbpath)
802804

803805
def remove_cache_backup(self) -> None:

0 commit comments

Comments
 (0)