From 7d81c17cca98b720d06743d6398d1184350ccc75 Mon Sep 17 00:00:00 2001 From: UncleCode Date: Thu, 28 Nov 2024 20:02:39 +0800 Subject: [PATCH] fix: improve handling of CRAWL4_AI_BASE_DIRECTORY environment variable in setup.py --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dbb07410..d891ff9f 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,8 @@ import asyncio # Create the .crawl4ai folder in the user's home directory if it doesn't exist # If the folder already exists, remove the cache folder -crawl4ai_folder = Path(os.getenv("CRAWL4_AI_BASE_DIRECTORY")) or Path.home() +base_dir = os.getenv("CRAWL4_AI_BASE_DIRECTORY") +crawl4ai_folder = Path(base_dir) if base_dir else Path.home() crawl4ai_folder = crawl4ai_folder / ".crawl4ai" cache_folder = crawl4ai_folder / "cache" content_folders = [