Skip to content

Commit

Permalink
create dir/sub-dir if they dont exist
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhiteh4t committed Sep 26, 2023
1 parent d269508 commit 27a51e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3

from os import getenv, path
from os import getenv, path, makedirs
from json import loads
from shutil import copytree

home = getenv('HOME')
usr_data = f'{home}/.local/share/finalrecon/dumps/'
Expand All @@ -14,9 +15,11 @@
log_file_path = f'{home}/.local/share/finalrecon/run.log'

if not path.exists(conf_path):
from shutil import copytree
copytree(src_conf_path, conf_path, dirs_exist_ok=True)

if not path.exists(usr_data):
makedirs(usr_data, exist_ok=True)

with open(conf_file_path, 'r') as config_file:
config_read = config_file.read()
config_json = loads(config_read)
Expand Down

0 comments on commit 27a51e6

Please sign in to comment.