Files
pmg/pkg/common/utils/utils.go
T

22 lines
369 B
Go
Raw Normal View History

package utils
2025-04-30 14:26:38 +05:30
func IsInstallCommand(pkgManager, cmd string) bool {
validActions := map[string]map[string]bool{
"npm": {
"install": true,
"i": true,
"add": true,
},
"pnpm": {
"add": true,
"install": true,
"i": true,
},
}
if actions, exists := validActions[pkgManager]; exists {
return actions[cmd]
}
return false
}