Skip to content

Commit dd4a9c3

Browse files
committed
fixup! fix(@angular/cli): report the worktree-local cache in ng cache info
1 parent 24fcf98 commit dd4a9c3

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

  • packages/angular/cli/src/commands/cache/info

‎packages/angular/cli/src/commands/cache/info/cli.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ export class CacheInfoCommandModule extends CommandModule implements CommandModu
3232
const { path, localPath, environment, enabled } = cacheConfig;
3333

3434
const effectiveStatus = this.effectiveEnabledStatus(cacheConfig);
35-
const sizeOnDisk = await this.getSizeOfDirectory(path);
35+
36+
// In a Git worktree, `path` is shared with the main checkout while `localPath` holds the
37+
// development server's Vite cache. Both are the same path outside of a worktree.
38+
const [sizeOnDisk, localSizeOnDisk] = await Promise.all([
39+
this.getSizeOfDirectory(path),
40+
localPath !== path ? this.getSizeOfDirectory(localPath) : undefined,
41+
]);
3642

3743
const info: { label: string; value: string }[] = [
3844
{
@@ -53,17 +59,15 @@ export class CacheInfoCommandModule extends CommandModule implements CommandModu
5359
},
5460
];
5561

56-
// In a Git worktree, `path` is shared with the main checkout while `localPath` holds the
57-
// development server's Vite cache. Both are the same path outside of a worktree.
58-
if (localPath !== path) {
62+
if (localSizeOnDisk !== undefined) {
5963
info.push(
6064
{
6165
label: 'Local path',
6266
value: colors.cyan(localPath),
6367
},
6468
{
6569
label: 'Local size on disk',
66-
value: colors.cyan(await this.getSizeOfDirectory(localPath)),
70+
value: colors.cyan(localSizeOnDisk),
6771
},
6872
);
6973
}

0 commit comments

Comments
 (0)