fix db_storage_path handling to use env variable or cwd (#507)

This commit is contained in:
Samuel Kocúr
2024-05-02 08:16:54 +02:00
committed by GitHub
parent 20a81af95f
commit c30bd1a18e

View File

@@ -1,3 +1,4 @@
import os
from pathlib import Path
import appdirs
@@ -13,6 +14,11 @@ def db_storage_path():
def get_project_directory_name():
cwd = Path.cwd()
project_directory_name = cwd.name
return project_directory_name
project_directory_name = os.environ.get("CREWAI_STORAGE_DIR")
if project_directory_name:
return project_directory_name
else:
cwd = Path.cwd()
project_directory_name = cwd.name
return project_directory_name