bugfix path
alex wennerberg alex@alexwennerberg.com
Wed, 18 Nov 2020 18:53:44 -0800
1 files changed,
6 insertions(+),
1 deletions(-)
jump to
M
main.go
→
main.go
@@ -88,6 +88,11 @@ l := len(strings.Split(c.FilesDirectory, "/"))
return strings.Join(strings.Split(filesPath, "/")[l:], "/") } +func getCreator(filePath string) string { + l := len(strings.Split(c.FilesDirectory, "/")) + return strings.Split(filePath, "/")[l] +} + func getIndexFiles() ([]*File, error) { // cache this function result := []*File{} err := filepath.Walk(c.FilesDirectory, func(thepath string, info os.FileInfo, err error) error {@@ -97,7 +102,7 @@ return err // think about
} // make this do what it should if !info.IsDir() { - creatorFolder := strings.Split(thepath, "/")[1] + creatorFolder := getCreator(thepath) updatedTime := info.ModTime() result = append(result, &File{ Name: getLocalPath(thepath),