From 04b93e9fd61776e9e1f27f6af3b49d8b774b7410 Mon Sep 17 00:00:00 2001 From: Teppei Fukuda Date: Tue, 14 Nov 2023 14:37:18 +0900 Subject: [PATCH] chore: not load plugins for auto-generating docs (#5569) Signed-off-by: knqyf263 --- magefiles/docs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/magefiles/docs.go b/magefiles/docs.go index 37d04343ecac..b69e813690af 100644 --- a/magefiles/docs.go +++ b/magefiles/docs.go @@ -3,6 +3,8 @@ package main import ( + "os" + "github.com/spf13/cobra/doc" "github.com/aquasecurity/trivy/pkg/commands" @@ -16,6 +18,9 @@ func main() { flag.CacheDirFlag.Default = "/path/to/cache" flag.ModuleDirFlag.Default = "$HOME/.trivy/modules" + // Set a dummy path not to load plugins + os.Setenv("XDG_DATA_HOME", os.TempDir()) + cmd := commands.NewApp() cmd.DisableAutoGenTag = true if err := doc.GenMarkdownTree(cmd, "./docs/docs/references/configuration/cli"); err != nil {