mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: nice progress bar
This commit is contained in:
1 parent
dab5e14297
commit
9d71471529
3 files changed
+5
-10
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import ProgressBar from 'progress';
|
||||
import { GithubChangeBlob, createBlob } from './createBlob';
|
||||
import { octokit } from './octokit';
|
||||
|
||||
@@ -30,21 +31,14 @@ export default async function commitMultipleFiles(
|
||||
})
|
||||
).data.tree.sha;
|
||||
const blobs: GithubChangeBlob[] = [];
|
||||
const bar = new ProgressBar('Blobs :bar', changes.length);
|
||||
|
||||
for (const changeIndexString in changes) {
|
||||
const changeIndex = parseInt(changeIndexString);
|
||||
const change = changes[changeIndex];
|
||||
const createdBlob = await createBlob(owner, repo, change);
|
||||
blobs.push(createdBlob!);
|
||||
|
||||
if (verbose) {
|
||||
console.log(
|
||||
`Created blob ${changeIndex + 1} / ${changes.length} (${(
|
||||
(100 * (changeIndex + 1)) /
|
||||
changes.length
|
||||
).toFixed(2)}%)`,
|
||||
);
|
||||
}
|
||||
bar.tick();
|
||||
}
|
||||
|
||||
const { data: treeData } = await octokit.git.createTree({
|
||||
|
||||
Reference in new issue
Block a user