generated from nhcarrigan/template
docs: add data file documentation and fix data path resolution
All Python cohort scripts now use DATA_DIR = Path(__file__).parent.parent.parent / "data" to correctly resolve the repo-root data/ directory regardless of the working directory set by run.sh. All TypeScript scripts have expanded JSDoc headers documenting data file requirements and environment variables.
This commit is contained in:
@@ -4,9 +4,12 @@
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import aiohttp
|
||||
|
||||
DATA_DIR = Path(__file__).parent.parent.parent / "data"
|
||||
|
||||
DISCORD_BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"]
|
||||
GUILD_ID = "692816967895220344"
|
||||
COHORT_ROLE_ID = "1464314780935258112"
|
||||
@@ -72,7 +75,7 @@ async def main() -> None:
|
||||
f"{i}. {member['display_name']} (@{member['username']}) - ID: {member['id']}" # noqa: E501
|
||||
)
|
||||
|
||||
with open("active_cohort_members.json", "w") as f:
|
||||
with open(DATA_DIR / "active_cohort_members.json", "w") as f:
|
||||
json.dump(cohort_members, f, indent=2)
|
||||
|
||||
print("\nSaved to active_cohort_members.json")
|
||||
|
||||
Reference in New Issue
Block a user