Replace filename with path without the local dir (#56296)

This commit is contained in:
Dimitris Sotirakis 2022-10-04 17:18:07 +03:00 committed by GitHub
parent 8176810b2b
commit d94af21cac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,8 +268,9 @@ func ListLocalFiles(dir string) ([]File, error) {
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
files = append(files, File{
FullPath: path,
PathTrimmed: info.Name(),
FullPath: path,
// Strip the dir name from the filepath
PathTrimmed: strings.ReplaceAll(path, dir, ""),
})
}
return nil