fix(render): use forward slashes in save-path footer for Windows
The footer line `📎 Raw results saved to ~/Documents\Last30Days\…` mangled the home-relative path on Windows because `f"~/{relative}"` stringifies a `pathlib.Path` with the OS-native separator. The result mixes a Unix tilde with backslashes, which neither File Explorer, PowerShell, nor a `file://` URI can resolve. `Path.as_posix()` always returns forward slashes, which is the convention `~/`-prefixed paths require on every platform. macOS and Linux output is unchanged because their separator is already `/`. Repro on Windows: python3 last30days.py "anything" --emit=compact --save-dir="$HOME/Documents/Last30Days" # before: 📎 Raw results saved to ~/Documents\Last30Days\anything-raw.md # after: 📎 Raw results saved to ~/Documents/Last30Days/anything-raw.md
This commit is contained in:
committed by
Trevin Chow
parent
7214dd6051
commit
a87c1ba058
@@ -195,7 +195,7 @@ def compute_save_path_display(save_dir: str, topic: str, suffix: str, emit: str)
|
||||
try:
|
||||
home = _Path.home().resolve()
|
||||
relative = raw.relative_to(home)
|
||||
return f"~/{relative}"
|
||||
return f"~/{relative.as_posix()}"
|
||||
except ValueError:
|
||||
return str(raw)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user