@@ -1190,17 +1190,17 @@ const pushBucket = async ({ returnOnZero } = { returnOnZero: false }) => {
1190
1190
buckets.push(...idBuckets);
1191
1191
}
1192
1192
1193
+ log('Pushing buckets ...');
1194
+
1193
1195
for (let bucket of buckets) {
1194
- log(`Pushing bucket ${bucket.name} ( ${ bucket['$id']} )`)
1196
+ log(`Pushing bucket ${chalk.bold( bucket['name'])} ...`);
1195
1197
1196
1198
try {
1197
1199
response = await storageGetBucket({
1198
1200
bucketId: bucket['$id'],
1199
1201
parseOutput: false,
1200
1202
})
1201
1203
1202
- log(`Updating bucket ...`)
1203
-
1204
1204
await storageUpdateBucket({
1205
1205
bucketId: bucket['$id'],
1206
1206
name: bucket.name,
@@ -1214,8 +1214,6 @@ const pushBucket = async ({ returnOnZero } = { returnOnZero: false }) => {
1214
1214
compression: bucket.compression,
1215
1215
parseOutput: false
1216
1216
});
1217
-
1218
- success(`Pushed ${bucket.name} ( ${bucket['$id']} )`);
1219
1217
} catch (e) {
1220
1218
if (Number(e.code) === 404) {
1221
1219
log(`Bucket ${bucket.name} does not exist in the project. Creating ... `);
@@ -1233,13 +1231,13 @@ const pushBucket = async ({ returnOnZero } = { returnOnZero: false }) => {
1233
1231
antivirus: bucket.antivirus,
1234
1232
parseOutput: false
1235
1233
})
1236
-
1237
- success(`Pushed ${bucket.name} ( ${bucket['$id']} )`);
1238
1234
} else {
1239
1235
throw e;
1240
1236
}
1241
1237
}
1242
1238
}
1239
+
1240
+ success(`Successfully pushed ${buckets.length} buckets.`);
1243
1241
}
1244
1242
1245
1243
const pushTeam = async ({ returnOnZero } = { returnOnZero: false }) => {
@@ -1269,24 +1267,22 @@ const pushTeam = async ({ returnOnZero } = { returnOnZero: false }) => {
1269
1267
teams.push(...idTeams);
1270
1268
}
1271
1269
1270
+ log('Pushing teams ...');
1271
+
1272
1272
for (let team of teams) {
1273
- log(`Pushing team ${team.name} ( ${ team['$id']} )`)
1273
+ log(`Pushing team ${chalk.bold( team['name'])} ...`);
1274
1274
1275
1275
try {
1276
1276
response = await teamsGet({
1277
1277
teamId: team['$id'],
1278
1278
parseOutput: false,
1279
1279
})
1280
1280
1281
- log(`Updating team ...`)
1282
-
1283
1281
await teamsUpdateName({
1284
1282
teamId: team['$id'],
1285
1283
name: team.name,
1286
1284
parseOutput: false
1287
1285
});
1288
-
1289
- success(`Pushed ${team.name} ( ${team['$id']} )`);
1290
1286
} catch (e) {
1291
1287
if (Number(e.code) === 404) {
1292
1288
log(`Team ${team.name} does not exist in the project. Creating ... `);
@@ -1296,13 +1292,13 @@ const pushTeam = async ({ returnOnZero } = { returnOnZero: false }) => {
1296
1292
name: team.name,
1297
1293
parseOutput: false
1298
1294
})
1299
-
1300
- success(`Pushed ${team.name} ( ${team['$id']} )`);
1301
1295
} else {
1302
1296
throw e;
1303
1297
}
1304
1298
}
1305
1299
}
1300
+
1301
+ success(`Successfully pushed ${teams.length} teams.`);
1306
1302
}
1307
1303
1308
1304
const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) => {
@@ -1340,8 +1336,10 @@ const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) =>
1340
1336
}
1341
1337
}
1342
1338
1339
+ log('Pushing topics ...');
1340
+
1343
1341
for (let topic of topics) {
1344
- log(`Pushing topic ${topic.name} ( ${ topic['$id']} )`)
1342
+ log(`Pushing topic ${chalk.bold( topic['name'])} ...`);
1345
1343
1346
1344
try {
1347
1345
response = await messagingGetTopic({
@@ -1355,16 +1353,12 @@ const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) =>
1355
1353
continue;
1356
1354
}
1357
1355
1358
- log(`Updating Topic ...`)
1359
-
1360
1356
await messagingUpdateTopic({
1361
1357
topicId: topic['$id'],
1362
1358
name: topic.name,
1363
1359
subscribe: topic.subscribe,
1364
1360
parseOutput: false
1365
1361
});
1366
-
1367
- success(`Pushed ${topic.name} ( ${topic['$id']} )`);
1368
1362
} catch (e) {
1369
1363
if (Number(e.code) === 404) {
1370
1364
log(`Topic ${topic.name} does not exist in the project. Creating ... `);
@@ -1382,6 +1376,8 @@ const pushMessagingTopic = async ({ returnOnZero } = { returnOnZero: false }) =>
1382
1376
}
1383
1377
}
1384
1378
}
1379
+
1380
+ success(`Successfully pushed ${topics.length} topics.`);
1385
1381
}
1386
1382
1387
1383
const push = new Command("push")
0 commit comments