Skip to content

Commit 9318d48

Browse files
committed
chore(cli): Cleaning added functions
1 parent 209c3fe commit 9318d48

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const inquirer = require("inquirer");
22
const JSONbig = require("json-bigint")({ storeAsString: false });
33
const { Command } = require("commander");
44
const { localConfig } = require("../config");
5-
const { loaderInterval, clearLoaderInterval, } = require('../utils');
65
const { Updater, SPINNER_ARC, SPINNER_DOTS } = require('../updater');
76
const { paginate } = require('../paginate');
87
const { questionsDeployBuckets, questionsDeployTeams, questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollections, questionsConfirmDeployCollections } = require("../questions");
@@ -438,7 +437,8 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
438437
}
439438
}
440439
updaterRow.stopSpinner();
441-
}))
440+
}));
441+
442442
Updater.stop();
443443

444444
success(`Pushed ${successfullyDeployed} functions`);

templates/cli/lib/utils.js.twig

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
const fs = require("fs");
22
const path = require("path");
33

4-
function loaderInterval(bar, max, start, timeout) {
5-
let a = start;
6-
7-
return setInterval(() => {
8-
if (a === max) a = start;
9-
bar.update({ progress: a++ })
10-
}, timeout);
11-
}
12-
13-
function clearLoaderInterval(bar, interval) {
14-
clearInterval(interval);
15-
bar.update({ progress: '⏳' })
16-
}
17-
184
function getAllFiles(folder) {
195
const files = [];
20-
for (const pathDir of fs.readdirSync(folder)) {
6+
for(const pathDir of fs.readdirSync(folder)) {
217
const pathAbsolute = path.join(folder, pathDir);
228
if (fs.statSync(pathAbsolute).isDirectory()) {
239
files.push(...getAllFiles(pathAbsolute));
@@ -29,7 +15,5 @@ function getAllFiles(folder) {
2915
}
3016

3117
module.exports = {
32-
getAllFiles,
33-
loaderInterval,
34-
clearLoaderInterval
18+
getAllFiles
3519
};

0 commit comments

Comments
 (0)