mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
Fix npm global flag usage (#166)
* fix global flag usage * add comment * Update packagemanager/npm_test.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> * Update packagemanager/npm_test.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> --------- Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -121,6 +121,9 @@ func (npm *npmPackageManager) ParseCommand(args []string) (*ParsedCommand, error
|
||||
flagSet.StringArrayVarP(&devPackages, "dev", "D", nil, "Install dev packages")
|
||||
}
|
||||
|
||||
// Known only to prevent UnknownFlags mode from swallowing the next package arg.
|
||||
flagSet.BoolP("global", "g", false, "Install packages globally")
|
||||
|
||||
err := flagSet.Parse(installArgs)
|
||||
if err != nil {
|
||||
return &ParsedCommand{Command: command}, nil
|
||||
|
||||
Reference in New Issue
Block a user