mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
* feat: Add separate package manager and resolver * fix: Npm dependency resolver * feat: Add analyzer for malysis query * feat: Add package manager guard as the orchestrator * feat: Add PMG to orchestrate installation * Add concurrent scan execution * Introduce package manager interaction abstraction * feat: Add UI port for guard * Remove refactored source files * Update README * fix: CI script for multi-arch build * ci: goreleaser CI fix * fix: npm command parser to extract package names * feat: Introduce global config primitive * fix: Close results channel for clean goroutine exit * ci: Add container image releaser * test: Improve test for npm resolver * refactor: Analyzer to generalise * Improve UI with additional info * fix: Goreleaser config * fix: npm resolver bug * fix: Fail when command exec workflow fails * fix: Bug with transitive dependency resolution * fix: Synchronize common data update in dependency resolver * chore: Improve log handling * docs: Update README * fix: UI text wrapping * fix: UI handling bugs * feat: Use concurrent dependency resolver
32 lines
694 B
Go
32 lines
694 B
Go
package npm
|
|
|
|
import (
|
|
_ "embed"
|
|
|
|
"github.com/safedep/dry/log"
|
|
"github.com/safedep/pmg/config"
|
|
"github.com/safedep/pmg/internal/ui"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func NewPnpmCommand() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "pnpm [action] [package]",
|
|
Short: "Guard pnpm package manager",
|
|
DisableFlagParsing: true,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
config, err := config.FromContext(cmd.Context())
|
|
if err != nil {
|
|
ui.Fatalf("Failed to get config: %s", err)
|
|
}
|
|
|
|
err = executePnpmFlow(cmd.Context(), config, args)
|
|
if err != nil {
|
|
log.Errorf("Failed to execute pnpm flow: %s", err)
|
|
}
|
|
|
|
return nil
|
|
},
|
|
}
|
|
}
|