Skip to content

Commit 1f98a3e

Browse files
committed
ensure r2 bucket list handler reflecting latest changes from #7212
1 parent 74db9ca commit 1f98a3e

File tree

2 files changed

+7
-41
lines changed

2 files changed

+7
-41
lines changed

packages/wrangler/src/r2/bucket.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { logger } from "../logger";
44
import * as metrics from "../metrics";
55
import { requireAuth } from "../user";
66
import { getValidBindingName } from "../utils/getValidBindingName";
7+
import formatLabelledValues from "../utils/render-labelled-values";
78
import { LOCATION_CHOICES } from "./constants";
89
import {
910
createR2Bucket,
1011
deleteR2Bucket,
1112
isValidR2BucketName,
1213
listR2Buckets,
14+
tablefromR2BucketsListResponse,
1315
updateR2BucketStorageClass,
1416
} from "./helpers";
1517

@@ -172,12 +174,11 @@ defineCommand({
172174
async handler(args, { config }) {
173175
const accountId = await requireAuth(config);
174176

175-
logger.log(
176-
JSON.stringify(await listR2Buckets(accountId, args.jurisdiction), null, 2)
177-
);
178-
await metrics.sendMetricsEvent("list r2 buckets", {
179-
sendMetrics: config.send_metrics,
180-
});
177+
logger.log(`Listing buckets...`);
178+
179+
const buckets = await listR2Buckets(accountId, args.jurisdiction);
180+
const tableOutput = tablefromR2BucketsListResponse(buckets);
181+
logger.log(tableOutput.map((x) => formatLabelledValues(x)).join("\n\n"));
181182
},
182183
});
183184

packages/wrangler/src/r2/list.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)