1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-28 01:32:41 +01:00

Let phutil_rebuild_map show a progress bar

Summary: .. Instead of dots that are hard to count.

Test Plan: remove `.phutil_module_cache` and do `arc liberate`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9584
This commit is contained in:
Richard van Velzen 2014-06-16 15:22:48 -07:00 committed by epriestley
parent b1ddd0f03b
commit 2ccf65353c

View file

@ -140,11 +140,15 @@ final class PhutilLibraryMapBuilder {
$this->log("Analyzing {$count} files with {$limit} subprocesses...\n");
$progress = new PhutilConsoleProgressBar();
$progress->setTotal(count($futures));
foreach (Futures($futures)->limit($limit) as $file => $future) {
$result = $future->resolveJSON();
if (empty($result['error'])) {
$symbol_map[$file] = $result;
} else {
$progress->done(false);
echo phutil_console_format(
"\n**SYNTAX ERROR!**\nFile: %s\nLine: %d\n\n%s\n",
Filesystem::readablePath($result['file']),
@ -152,8 +156,9 @@ final class PhutilLibraryMapBuilder {
$result['error']);
exit(1);
}
$this->log('.');
$progress->update(1);
}
$progress->done();
$this->log("\nDone.\n");
}