diff --git a/internal/canvas/client.go b/internal/canvas/client.go index e0fe885..19d443a 100644 --- a/internal/canvas/client.go +++ b/internal/canvas/client.go @@ -112,7 +112,11 @@ func (c *Client) DownloadCourseFiles(root string) { subDir := root if !c.FilesOnly { - subDir = filepath.Join(root, "Course Files", safeFolderPath) + if safeFolderPath != "" && strings.ToLower(safeFolderPath) != "course files" { + subDir = filepath.Join(root, "Course Files", safeFolderPath) + } else { + subDir = filepath.Join(root, "Course Files") + } } os.MkdirAll(subDir, 0o755) path := filepath.Join(subDir, utils.Sanitize(file.DisplayName))