mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: Introduce global config primitive
This commit is contained in:
+8
-1
@@ -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)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user