Skip to content

Commit 32f9de3

Browse files
committed
wip: Deploy function in parallelism.
1 parent 6dc761b commit 32f9de3

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

src/SDK/Language/CLI.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ public function getFiles(): array
137137
'destination' => 'lib/formatters.js',
138138
'template' => 'cli/lib/formatters.js.twig',
139139
],
140+
[
141+
'scope' => 'default',
142+
'destination' => 'lib/updateTable.js',
143+
'template' => 'cli/lib/updateTable.js.twig',
144+
],
140145
[
141146
'scope' => 'default',
142147
'destination' => 'lib/parser.js',

templates/cli/lib/commands/deploy.js.twig

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const _progress = require('cli-progress');
21
const inquirer = require("inquirer");
32
const JSONbig = require("json-bigint")({ storeAsString: false });
43
const { Command } = require("commander");
@@ -272,13 +271,7 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
272271
return func;
273272
});
274273

275-
const updatesBar = new _progress.MultiBar({
276-
format: formatterFunction,
277-
hideCursor: true,
278-
clearOnComplete: false,
279-
stopOnComplete: true,
280-
noTTYOutput: true
281-
});
274+
282275

283276
log('Deploying functions\n');
284277

templates/cli/lib/updateTable.js.twig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const progress = require('cli-progress');
2+
3+
class UpdateTable {
4+
static init(format, clearOnComplete = true, hideCursor = true) {
5+
this.updatesBar = new progress.MultiBar({
6+
format,
7+
hideCursor,
8+
clearOnComplete,
9+
stopOnComplete: true,
10+
noTTYOutput: true
11+
});
12+
}
13+
14+
constructor(value, end, endTitle = '', type = '', maxValue = 1, currentValue = 0) {
15+
this.bar = UpdateTable.updatesBar.create(1, 0, { status: 'Deploying', function: func.name, id: func['$id'], ignore })
16+
17+
}
18+
19+
}
20+
21+
module.exports = {
22+
UpdateTable
23+
}

0 commit comments

Comments
 (0)