From 2b6198907381e76fd8ad0f9f879ba863af4e56f4 Mon Sep 17 00:00:00 2001 From: suhasgumma Date: Tue, 29 Nov 2022 18:15:30 +0530 Subject: [PATCH] Fix local directory relative path --- core/pkg/resourcehandler/filesloader.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/pkg/resourcehandler/filesloader.go b/core/pkg/resourcehandler/filesloader.go index 933e392b..600a662c 100644 --- a/core/pkg/resourcehandler/filesloader.go +++ b/core/pkg/resourcehandler/filesloader.go @@ -103,6 +103,8 @@ func getResourcesFromPath(path string) (map[string]reporthandling.Source, []work gitRepo, err := cautils.NewLocalGitRepository(path) if err == nil && gitRepo != nil { repoRoot, _ = gitRepo.GetRootDir() + } else { + repoRoot, _ = filepath.Abs(path) } // load resource from local file system @@ -141,7 +143,7 @@ func getResourcesFromPath(path string) (map[string]reporthandling.Source, []work } workloadSource := reporthandling.Source{ - RelativePath: source, + RelativePath: relSource, FileType: filetype, LastCommit: lastCommit, }