Skip to content

Commit

Permalink
chore: not load plugins for auto-generating docs (#5569)
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <knqyf263@gmail.com>
  • Loading branch information
knqyf263 committed Nov 14, 2023
1 parent cccaa15 commit 04b93e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions magefiles/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package main

import (
"os"

"github.com/spf13/cobra/doc"

"github.com/aquasecurity/trivy/pkg/commands"
Expand All @@ -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 {
Expand Down

0 comments on commit 04b93e9

Please sign in to comment.