1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-01 03:02:42 +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"); $this->log("Analyzing {$count} files with {$limit} subprocesses...\n");
$progress = new PhutilConsoleProgressBar();
$progress->setTotal(count($futures));
foreach (Futures($futures)->limit($limit) as $file => $future) { foreach (Futures($futures)->limit($limit) as $file => $future) {
$result = $future->resolveJSON(); $result = $future->resolveJSON();
if (empty($result['error'])) { if (empty($result['error'])) {
$symbol_map[$file] = $result; $symbol_map[$file] = $result;
} else { } else {
$progress->done(false);
echo phutil_console_format( echo phutil_console_format(
"\n**SYNTAX ERROR!**\nFile: %s\nLine: %d\n\n%s\n", "\n**SYNTAX ERROR!**\nFile: %s\nLine: %d\n\n%s\n",
Filesystem::readablePath($result['file']), Filesystem::readablePath($result['file']),
@ -152,8 +156,9 @@ final class PhutilLibraryMapBuilder {
$result['error']); $result['error']);
exit(1); exit(1);
} }
$this->log('.'); $progress->update(1);
} }
$progress->done();
$this->log("\nDone.\n"); $this->log("\nDone.\n");
} }