Skip to content

Commit

Permalink
Remove cli progress
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Jul 12, 2024
1 parent d5e6ca6 commit fe0a636
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"start": "bun run src/index.ts"
},
"dependencies": {
"cli-progress": "^3.12.0",
"inly": "^5.0.1",
"pinyin-pro": "^3.18.5",
"yomichan-dict-builder": "^2.6.0"
Expand Down
20 changes: 6 additions & 14 deletions src/util/readAndProcessLines.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { file } from 'bun';
import { Dictionary } from 'yomichan-dict-builder';
import * as cliProgress from 'cli-progress';
import { processLine } from '../yomitan/processLine';
import { LanguageCode } from '../constants';

Expand All @@ -15,13 +14,6 @@ export async function readAndProcessLines(
const lineReader = fileReader.getReader();
let processedLines = 0;
let buffer = '';
// const progressBar = new cliProgress.SingleBar({
// format: `{value} lines | {file}`,
// });

// progressBar.start(0, 0, {
// file: filePath,
// });

while (true) {
const { done, value } = await lineReader.read();
Expand All @@ -38,18 +30,18 @@ export async function readAndProcessLines(
buffer = buffer.slice(lineEnd + 1);
processedLines++;

// progressBar.update(processedLines);

if (processedLines >= 1000 && dev) {
return processedLines;
}

if (processedLines % 1000 === 0) {
console.log(`Processed ${processedLines} lines`);
if (processedLines % 10000 === 0) {
console.log(
`[${lang}] ${new Date()
.toTimeString()
.slice(0, 8)}: Processed ${processedLines} lines`
);
}
}
}

// progressBar.stop();
return processedLines;
}

0 comments on commit fe0a636

Please sign in to comment.