Fixed count bug

This commit is contained in:
Anthony Axenov 2023-08-09 21:31:08 +08:00
parent b9c804b0f6
commit 9613697ada
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC

View File

@ -200,10 +200,11 @@ class Processor
$this->initConverters(); $this->initConverters();
$this->initCollections(); $this->initCollections();
$count = count($this->collections); $count = count($this->collections);
$current = 1; $current = 0;
$success = 0; $success = 0;
print(implode(PHP_EOL, array_merge($this->version(), $this->copyright())) . PHP_EOL . PHP_EOL); print(implode(PHP_EOL, array_merge($this->version(), $this->copyright())) . PHP_EOL . PHP_EOL);
foreach ($this->collections as $collectionName => $collection) { foreach ($this->collections as $collectionName => $collection) {
++$current;
printf("Converting '%s' (%d/%d):%s", $collectionName, $current, $count, PHP_EOL); printf("Converting '%s' (%d/%d):%s", $collectionName, $current, $count, PHP_EOL);
foreach ($this->converters as $type => $exporter) { foreach ($this->converters as $type => $exporter) {
printf(' > %s', strtolower($type)); printf(' > %s', strtolower($type));
@ -212,7 +213,6 @@ class Processor
printf(' - OK: %s%s', $exporter->getOutputPath(), PHP_EOL); printf(' - OK: %s%s', $exporter->getOutputPath(), PHP_EOL);
} }
print(PHP_EOL); print(PHP_EOL);
++$current;
++$success; ++$success;
} }
$this->printStats($success, $current); $this->printStats($success, $current);