fix(settings): move os.path.exists inside try block in update_env_file so exceptions are non-fatal
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/1f6c42dc-d64b-4263-a83a-f2263d865692
This commit is contained in:
@@ -3388,11 +3388,11 @@ def update_env_file(env_path: str, settings_to_update: dict[str, str]) -> bool:
|
||||
Returns:
|
||||
True if the file was successfully updated, False otherwise (e.g. file not found or write error)
|
||||
"""
|
||||
if not os.path.exists(env_path):
|
||||
logger.warning(f".env file not found at {env_path}, skipping file update")
|
||||
return False
|
||||
|
||||
try:
|
||||
if not os.path.exists(env_path):
|
||||
logger.warning(f".env file not found at {env_path}, skipping file update")
|
||||
return False
|
||||
|
||||
logger.info(f"Updating settings in {env_path}")
|
||||
|
||||
# Read the current .env file
|
||||
|
||||
Reference in New Issue
Block a user