From c3736c90529da4893cc4bf087fe1d08959b79f97 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani <45800463+rchincha@users.noreply.github.com> Date: Wed, 26 Apr 2023 23:09:27 -0700 Subject: [PATCH] fix: exclude files also for inventory (#26) Signed-off-by: Ramkumar Chinchani --- pkg/fs/inventory.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/fs/inventory.go b/pkg/fs/inventory.go index 47679fa..c85ac39 100644 --- a/pkg/fs/inventory.go +++ b/pkg/fs/inventory.go @@ -48,6 +48,11 @@ func GenerateInventory(root string, exclude []string, output string) error { return filepath.SkipDir } + // skip excluded files + if isExcluded(path, exclude) { + return nil + } + // skip dirs for generating the inventory if info.IsDir() { return nil