From 65ca1652c05e15f1bdf941afacfead7464ce8ad0 Mon Sep 17 00:00:00 2001 From: uh_wot <3631986-uh_wot@users.noreply.gitlab.com> Date: Mon, 18 May 2020 12:31:56 +0200 Subject: [PATCH] Made config folder creation recursive --- deemix/app/settings.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/deemix/app/settings.py b/deemix/app/settings.py index c449eaf..226132d 100644 --- a/deemix/app/settings.py +++ b/deemix/app/settings.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import json import os.path as path -from os import mkdir, makedirs +from os import makedirs import deemix.utils.localpaths as localpaths @@ -14,8 +14,7 @@ def initSettings(): global defaultSettings currentFolder = path.abspath(path.dirname(__file__)) configFolder = localpaths.getConfigFolder() - if not path.isdir(configFolder): - mkdir(configFolder) + makedirs(configFolder, exist_ok=True) with open(path.join(currentFolder, 'default.json'), 'r') as d: defaultSettings = json.load(d) defaultSettings['downloadLocation'] = path.join(localpaths.getHomeFolder(), 'deemix Music') @@ -27,7 +26,7 @@ def initSettings(): settingsCheck() if settings['downloadLocation'] == "": settings['downloadLocation'] = path.join(localpaths.getHomeFolder(), 'deemix Music') - saveSettings(settings) + saveSettings(settings) makedirs(settings['downloadLocation'], exist_ok=True) return settings