Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion taskweaver/utils/app_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from os import listdir, path
from typing import Optional, Tuple

Expand All @@ -13,7 +14,14 @@ def validate_app_config(workspace: str) -> bool:
config_path = path.join(workspace, "taskweaver_config.json")
if not path.exists(config_path):
return False
# TODO: read, parse and validate config
try:
with open(config_path, "r", encoding="utf-8") as f:
data = json.load(f)
# Config must be a dictionary (key-value pairs)
if not isinstance(data, dict):
return False
except (json.JSONDecodeError, OSError):
return False
return True

def is_dir_valid(dir: str) -> bool:
Expand Down