feat: dont delete code

This commit is contained in:
Florian Hönicke
2023-04-13 16:34:53 +02:00
parent 89ceedb644
commit 04febfa506
2 changed files with 21 additions and 20 deletions

View File

@@ -6,13 +6,14 @@ from typing import Generator
import sys
from contextlib import contextmanager
def recreate_folder(folder_path):
if os.path.exists(folder_path) and os.path.isdir(folder_path):
shutil.rmtree(folder_path)
os.makedirs(folder_path)
def create_folder_if_not_exist(folder_path):
try:
os.makedirs(folder_path)
except FileExistsError:
pass
def persist_file(file_content, file_name):
with open(f'{file_name}', 'w') as f:
def persist_file(file_content, file_path):
with open(file_path, 'w') as f:
f.write(file_content)