Skip to content

Commit 7211609

Browse files
authored
fix(wrangler): vectorize list-vectors should output valid json (#10517)
* fix(wrangler): vectorize list-vectors should output valid json * add changeset
1 parent 4cb3370 commit 7211609

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.changeset/heavy-planets-feel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
fix: `wrangler vectorize list-vectors --json` now output valid json without an extra log line

packages/wrangler/src/__tests__/vectorize/vectorize.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,7 @@ describe("vectorize commands", () => {
781781
mockVectorizeV2Request();
782782
await runWrangler("vectorize list-vectors test-index --json");
783783
expect(std.out).toMatchInlineSnapshot(`
784-
"📋 Listing vectors in index 'test-index'...
785-
{
784+
"{
786785
\\"count\\": 3,
787786
\\"totalCount\\": 5,
788787
\\"isTruncated\\": true,

packages/wrangler/src/vectorize/listVectors.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export const vectorizeListVectorsCommand = createCommand({
4747
},
4848
positionalArgs: ["name"],
4949
async handler(args, { config }) {
50-
logger.log(`📋 Listing vectors in index '${args.name}'...`);
50+
if (!args.json) {
51+
logger.log(`📋 Listing vectors in index '${args.name}'...`);
52+
}
5153

5254
const options: Parameters<typeof listVectors>[2] = {};
5355
if (args.count !== undefined) {

0 commit comments

Comments
 (0)