forked from zuckerberg/dailybot
Don't create drastikbot config directory in user's home
This commit is contained in:
parent
37c02dea3c
commit
c08d3a9fab
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
drastikbot
|
@ -74,13 +74,13 @@ def parser():
|
|||||||
" already exists.")
|
" already exists.")
|
||||||
conf_dir = str(path.expanduser().resolve())
|
conf_dir = str(path.expanduser().resolve())
|
||||||
else:
|
else:
|
||||||
path = Path('~/.drastikbot').expanduser()
|
path = Path('./drastikbot').expanduser()
|
||||||
if not path.is_dir():
|
if not path.is_dir():
|
||||||
try:
|
try:
|
||||||
path.mkdir(parents=True, exist_ok=False)
|
path.mkdir(parents=True, exist_ok=False)
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
sys.exit("[Error] Making configuration directory at"
|
sys.exit("[Error] Making configuration directory at"
|
||||||
" '~/.drastikbot' failed. Another file with that name"
|
" './drastikbot' failed. Another file with that name"
|
||||||
" already exists.")
|
" already exists.")
|
||||||
conf_dir = str(path)
|
conf_dir = str(path)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user