Skip to content

Commit e4719bf

Browse files
committed
Use LiveRenderer for sequential mode
Sequential mode now shows the same spinner and progress animation as parallel mode. The only difference is execution order.
1 parent bed9c2e commit e4719bf

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

src/shared/Commands.cs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,28 @@ private static List<RepoResult> RunSequential(
3636
var results = new List<RepoResult>();
3737
var fetchCache = new Dictionary<string, (bool Failed, string Message)>();
3838

39-
for (int i = 0; i < repos.Count; i++)
39+
using (var renderer = new LiveRenderer(repos.Count))
4040
{
41-
string commonDir = GetCommonGitDir(repos[i]);
42-
if (!fetchCache.TryGetValue(commonDir, out var fetchResult))
41+
for (int i = 0; i < repos.Count; i++)
4342
{
44-
fetchResult = Fetch(repos[i], extraArgs);
45-
fetchCache[commonDir] = fetchResult;
46-
}
43+
renderer.StartRepo(Path.GetRelativePath(rootPath, repos[i]));
4744

48-
RepoResult result = fetchResult.Failed
49-
? BuildResult(repos[i], rootPath, fetchResult)
50-
: command == "pull"
51-
? Pull(repos[i], rootPath, extraArgs)
52-
: BuildResult(repos[i], rootPath, fetchResult);
53-
54-
results.Add(result);
55-
Output.WriteResult(result, i + 1, repos.Count);
45+
string commonDir = GetCommonGitDir(repos[i]);
46+
if (!fetchCache.TryGetValue(commonDir, out var fetchResult))
47+
{
48+
fetchResult = Fetch(repos[i], extraArgs);
49+
fetchCache[commonDir] = fetchResult;
50+
}
51+
52+
RepoResult result = fetchResult.Failed
53+
? BuildResult(repos[i], rootPath, fetchResult)
54+
: command == "pull"
55+
? Pull(repos[i], rootPath, extraArgs)
56+
: BuildResult(repos[i], rootPath, fetchResult);
57+
58+
results.Add(result);
59+
renderer.CompleteRepo(result);
60+
}
5661
}
5762

5863
return results;

0 commit comments

Comments
 (0)