mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-25 01:14:24 +01:00
feat: dont delete code
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user