mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
Introduce package manager interaction abstraction
This commit is contained in:
@@ -42,6 +42,14 @@ func (npm *npmPackageManager) Name() string {
|
||||
}
|
||||
|
||||
func (npm *npmPackageManager) ParseCommand(args []string) (*ParsedCommand, error) {
|
||||
if len(args) == 0 {
|
||||
return nil, fmt.Errorf("no command specified")
|
||||
}
|
||||
|
||||
if args[0] == "npm" || args[0] == "pnpm" {
|
||||
args = args[1:]
|
||||
}
|
||||
|
||||
command := Command{Exe: npm.Config.CommandName, Args: args}
|
||||
|
||||
// No command specified
|
||||
|
||||
Reference in New Issue
Block a user