Skip to content

Commit

Permalink
fix: type not added in previous PR
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Goller <[email protected]>
  • Loading branch information
goller committed May 16, 2024
1 parent 23cd912 commit 450b39f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/mounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ interface FileSystems {

// Returns the paths of all overlayfs mounts that are children of the given path.
// This is useful to unmount all child mounts before unmounting the parent.
export async function findOverlayPaths(path: string): Promise<string[]> {
export async function findOverlayPaths(path: string, seenPaths: Set<string>): Promise<string[]> {
try {
const {stdout} = await execa('findmnt', ['-R', '-J', path])
const fs: FileSystems = JSON.parse(stdout)
Expand All @@ -261,6 +261,7 @@ export async function findOverlayPaths(path: string): Promise<string[]> {
const childTargets = new Set<string>()
for (const f of fs.filesystems) {
for (const c of f.children ?? []) {
if (seenPaths.has(c.target)) continue
childTargets.add(c.target)
}
}
Expand Down

0 comments on commit 450b39f

Please sign in to comment.