Files
pmg/cmd/npm/pnpm.go
T

26 lines
548 B
Go
Raw Normal View History

2025-04-30 14:26:38 +05:30
package npm
import (
_ "embed"
2025-05-14 16:09:29 +05:30
"fmt"
2025-04-30 14:26:38 +05:30
2025-05-14 16:09:29 +05:30
"github.com/safedep/pmg/config"
2025-04-30 14:26:38 +05:30
"github.com/spf13/cobra"
)
func NewPnpmCommand() *cobra.Command {
return &cobra.Command{
2025-04-30 14:26:38 +05:30
Use: "pnpm [action] [package]",
Short: "Guard pnpm package manager",
2025-04-30 14:26:38 +05:30
DisableFlagParsing: true,
RunE: func(cmd *cobra.Command, args []string) error {
2025-05-14 16:09:29 +05:30
config, err := config.FromContext(cmd.Context())
if err != nil {
return fmt.Errorf("failed to get config: %w", err)
}
return executePnpmFlow(cmd.Context(), config, args)
2025-04-30 14:26:38 +05:30
},
}
}