Commit 539dee31 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Config: Fix config dir creation for GNU/Linux.

Showing with 11 additions and 4 deletions
+11 -4
......@@ -242,11 +242,13 @@ class Config(SQL):
file = ""
if os.name == 'posix':
file = os.path.expanduser('~') + config_dir + config_file
ndir = os.path.expanduser('~') + config_dir
else:
ndir = os.path.expanduser('~') + config_dir.replace("/", "\\")
os.makedirs(ndir, exist_ok = True)
file = ndir + config_file
ndir = os.path.expanduser('~') + config_dir
ndir = ndir.replace("/", "\\")
os.makedirs(ndir, exist_ok = True)
file = ndir + config_file
return file
......
......@@ -184,6 +184,11 @@ class SQL(object):
def _init_db_file(self, db):
exists = Path(db).exists()
os.makedirs(
os.path.dirname(db),
exist_ok = True
)
self._db = sqlite3.connect(db)
self._cur = self._db.cursor()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment