Screenshot Directory Priority Implementation | Generated by AI
Done. Here is a summary of the changes:
Priority for screenshot save directory:
SCREENSHOT_DIRfrom.env(global config) – checked first[dir]CLI argument – fallback if no env config.(current dir) for macOS,assets/screenshotsfor Linux – final default
Files changed:
/Users/lzwjava/projects/ww/ww/image/screenshot.py– Addedload_dotenv(), readsSCREENSHOT_DIRenv var first, then falls back to CLI[dir], then.. Resolution:env_dir or cli_dir or "."/Users/lzwjava/projects/ww/ww/image/screenshot_linux.py– Moved all module-level code insidemain(), addedload_dotenv(), readsSCREENSHOT_DIRwith fallback toassets/screenshots. Resolution:env_dir or "assets/screenshots"/Users/lzwjava/projects/ww/.env– AddedSCREENSHOT_DIR=config entry (currently empty, meaning use defaults)/Users/lzwjava/projects/ww/ww/main.py– Updated help text to mentionSCREENSHOT_DIR/Users/lzwjava/projects/ww/README.md– Updated docs
To use it, set SCREENSHOT_DIR in your .env, e.g.:
SCREENSHOT_DIR=/Users/lzwjava/projects/jekyll-ai-blog/assets/screenshots
If empty or unset, the old behavior is preserved (. for macOS, assets/screenshots for Linux, or whatever you pass as [dir]).