From 2ccf65353cd1160b7ceb36ce36609040db06f7db Mon Sep 17 00:00:00 2001 From: Richard van Velzen Date: Mon, 16 Jun 2014 15:22:48 -0700 Subject: [PATCH] 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 --- scripts/lib/PhutilLibraryMapBuilder.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/lib/PhutilLibraryMapBuilder.php b/scripts/lib/PhutilLibraryMapBuilder.php index bd37934f..ef709602 100644 --- a/scripts/lib/PhutilLibraryMapBuilder.php +++ b/scripts/lib/PhutilLibraryMapBuilder.php @@ -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"); }