Fix creating config file on Windows
This commit is contained in:
+7
-4
@@ -15,7 +15,7 @@ import configparser
|
|||||||
import sys
|
import sys
|
||||||
import nw
|
import nw
|
||||||
|
|
||||||
from os import path, mkdir, getcwd
|
from os import path, mkdir, makedirs, getcwd
|
||||||
from appdirs import user_config_dir
|
from appdirs import user_config_dir
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@@ -166,9 +166,12 @@ class Config:
|
|||||||
|
|
||||||
# If config folder does not exist, make it.
|
# If config folder does not exist, make it.
|
||||||
# This assumes that the os config folder itself exists.
|
# This assumes that the os config folder itself exists.
|
||||||
# TODO: This does not work on Windows
|
if self.osWindows:
|
||||||
if not path.isdir(self.confPath):
|
if not path.isdir(self.confPath):
|
||||||
mkdir(self.confPath)
|
makedirs(self.confPath)
|
||||||
|
else:
|
||||||
|
if not path.isdir(self.confPath):
|
||||||
|
mkdir(self.confPath)
|
||||||
|
|
||||||
# Check if config file exists
|
# Check if config file exists
|
||||||
if path.isfile(path.join(self.confPath,self.confFile)):
|
if path.isfile(path.join(self.confPath,self.confFile)):
|
||||||
|
|||||||
Reference in New Issue
Block a user