mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Replace filename with path without the local dir (#56296)
This commit is contained in:
parent
8176810b2b
commit
d94af21cac
@ -268,8 +268,9 @@ func ListLocalFiles(dir string) ([]File, error) {
|
|||||||
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
|
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
|
||||||
if !info.IsDir() {
|
if !info.IsDir() {
|
||||||
files = append(files, File{
|
files = append(files, File{
|
||||||
FullPath: path,
|
FullPath: path,
|
||||||
PathTrimmed: info.Name(),
|
// Strip the dir name from the filepath
|
||||||
|
PathTrimmed: strings.ReplaceAll(path, dir, ""),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user