feat: Introduce global config primitive

This commit is contained in:
abhisek
2025-05-14 16:09:29 +05:30
parent 86a0a8f5a4
commit 8896917c4d
6 changed files with 69 additions and 11 deletions
+8 -1
View File
@@ -2,7 +2,9 @@ package npm
import (
_ "embed"
"fmt"
"github.com/safedep/pmg/config"
"github.com/spf13/cobra"
)
@@ -12,7 +14,12 @@ func NewPnpmCommand() *cobra.Command {
Short: "Guard pnpm package manager",
DisableFlagParsing: true,
RunE: func(cmd *cobra.Command, args []string) error {
return executePnpmFlow(args)
config, err := config.FromContext(cmd.Context())
if err != nil {
return fmt.Errorf("failed to get config: %w", err)
}
return executePnpmFlow(cmd.Context(), config, args)
},
}
}