Skip to content

Commit 7b09898

Browse files
committed
fix(drive_service): drop redundant print; --json now emits clean JSON
`list_folder_with_paths` printed `📁 Listing folder: <path>` to stdout unconditionally. In normal text-mode that's fine (the CLI's `list_path` function also echoes the same header before showing the table), but in `--json` mode it corrupted the output — JSON consumers got a non-JSON header line followed by the actual payload. Caught by CrispSorter's `InternxtDrive::list_dir`, which calls `cli.py list-path --json` and serde_json-parses stdout. The duplicated print broke that parse on every call. Drop the print from `services/drive.py` — the human-readable header in cli.py's text-mode codepath (line 1293) is unchanged, so end users see exactly the same TUI output.
1 parent e9db765 commit 7b09898

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

services/drive.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,15 @@ def download_file_by_path(self, file_path: str, destination_path_str: Optional[s
253253
return self.download_file(file_uuid, destination_path_str)
254254

255255
def list_folder_with_paths(self, folder_path: str = "/") -> Dict[str, List[Dict[str, Any]]]:
256-
"""List folder contents with full paths"""
257-
print(f"📁 Listing folder: {folder_path}")
258-
256+
"""List folder contents with full paths.
257+
258+
Note: caller is responsible for any human-readable status output.
259+
We used to emit a `📁 Listing folder: …` line here, but that broke
260+
machine-readable consumers (CrispSorter's InternxtDrive parses
261+
`cli.py list-path --json` and choked on the leading non-JSON
262+
bytes). The CLI's text-mode codepath in `cli.py:list_path`
263+
still echoes the header for human users.
264+
"""
259265
if folder_path == "" or folder_path == "/":
260266
resolved = self.resolve_path("/")
261267
else:

0 commit comments

Comments
 (0)