Skip to content

Commit 35f5efd

Browse files
committed
CLI: Add getBucket to config
1 parent 7df24c2 commit 35f5efd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

templates/cli/lib/config.js.twig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ class Local extends Config {
141141
return this.get("buckets");
142142
}
143143

144+
getBucket($id) {
145+
if (!this.has("buckets")) {
146+
return {};
147+
}
148+
149+
let buckets = this.get("buckets");
150+
for (let i = 0; i < buckets.length; i++) {
151+
if (buckets[i]['$id'] == $id) {
152+
return buckets[i];
153+
}
154+
}
155+
156+
return {};
157+
}
158+
144159
getCollection($id) {
145160
if (!this.has("collection")) {
146161
return {};

0 commit comments

Comments
 (0)