From 7f5a44435028851315bdde7e03eb0726c010bb82 Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 21 Aug 2025 18:00:44 -0400 Subject: [PATCH] gendocs: ignore missing rclone_mount.md on macOS --- cmd/gendocs/gendocs.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/gendocs/gendocs.go b/cmd/gendocs/gendocs.go index f1186bef2..e185ae9d8 100644 --- a/cmd/gendocs/gendocs.go +++ b/cmd/gendocs/gendocs.go @@ -8,6 +8,7 @@ import ( "path" "path/filepath" "regexp" + "runtime" "strings" "text/template" "time" @@ -91,7 +92,7 @@ rclone.org website.`, Aliases []string Annotations map[string]string } - var commands = map[string]commandDetails{} + commands := map[string]commandDetails{} var addCommandDetails func(root *cobra.Command, parentAliases []string) addCommandDetails = func(root *cobra.Command, parentAliases []string) { name := strings.ReplaceAll(root.CommandPath(), " ", "_") + ".md" @@ -158,7 +159,7 @@ rclone.org website.`, return err } - var outdentTitle = regexp.MustCompile(`(?m)^#(#+)`) + outdentTitle := regexp.MustCompile(`(?m)^#(#+)`) // Munge the files to add a link to the global flags page err = filepath.Walk(out, func(path string, info os.FileInfo, err error) error { @@ -169,6 +170,9 @@ rclone.org website.`, name := filepath.Base(path) cmd, ok := commands[name] if !ok { + if name == "rclone_mount.md" && runtime.GOOS == "darwin" { + return nil // won't exist without -tags cmount + } return fmt.Errorf("didn't find command for %q", name) } b, err := os.ReadFile(path)