@@ -8,23 +8,20 @@ const { exec } = require('child_process');
8
8
const folderPath = path . join ( __dirname , "./../out" ) ;
9
9
const outputFolder = path . join ( __dirname , "./../output" ) ;
10
10
const tempFolder = path . join ( __dirname , "./../temp" ) ;
11
- const MAX_WORKERS = 24 ; // Maximální počet workerů
11
+ const MAX_WORKERS = 24 ;
12
12
13
13
const args = process . argv . slice ( 2 ) ;
14
14
const clearTemp = args . includes ( '-ct' ) ;
15
15
const clearOutput = args . includes ( '-co' ) ;
16
16
17
- // Vytvořte složky, pokud neexistují
18
17
if ( ! fs . existsSync ( outputFolder ) || ! fs . existsSync ( tempFolder ) ) {
19
18
! fs . existsSync ( outputFolder ) && fs . mkdirSync ( outputFolder ) ;
20
19
! fs . existsSync ( tempFolder ) && fs . mkdirSync ( tempFolder ) ;
21
20
}
22
21
23
- // Vyčistěte složky, pokud je to požadováno
24
22
if ( clearTemp ) fsExtra . emptyDirSync ( tempFolder ) ;
25
23
if ( clearOutput ) fsExtra . emptyDirSync ( outputFolder ) ;
26
24
27
- // Funkce pro vytvoření pokrokového ukazatele
28
25
function createIntermediateProgressOutput ( taskName , totalSteps , labelWidth = 40 ) {
29
26
let lastDisplayed = 0 ;
30
27
return function ( currentStep ) {
@@ -41,7 +38,6 @@ function createIntermediateProgressOutput(taskName, totalSteps, labelWidth = 40)
41
38
} ;
42
39
}
43
40
44
- // Funkce pro převod nibbles na bajty
45
41
function nibblesToBytes ( nibbles ) {
46
42
const bytes = [ ] ;
47
43
for ( let i = 0 ; i < nibbles . length ; i += 2 ) {
@@ -51,7 +47,6 @@ function nibblesToBytes(nibbles) {
51
47
return bytes ;
52
48
}
53
49
54
- // Funkce pro extrakci dat ze souboru
55
50
function extractFileData ( nibbles ) {
56
51
const dataNibbles = [ ] ;
57
52
const nameNibbles = [ ] ;
@@ -74,7 +69,6 @@ function extractFileData(nibbles) {
74
69
return { dataNibbles, nameNibbles } ;
75
70
}
76
71
77
- // Funkce pro zpracování souborů s omezeným počtem workerů
78
72
async function processWithLimitedWorkers ( filePaths , maxWorkers ) {
79
73
const progressTracker = new Array ( filePaths . length ) . fill ( 0 ) ;
80
74
const processFilesProgress = createIntermediateProgressOutput ( 'Processing Images ->' , filePaths . length ) ;
0 commit comments