Skip to content

Commit

Permalink
feat(pnpm): provide supports to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
iseki-working committed Jul 27, 2023
1 parent ad5ec66 commit 15d37c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 6 additions & 6 deletions module/pnpm/pnpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ var EcoRepo = model.EcoRepo{
Repository: "",
}

type _PnpmInspector struct{}
type Inspector struct{}

func (_PnpmInspector) String() string {
func (Inspector) String() string {
return "PNPMInspector"
}

func (_PnpmInspector) CheckDir(dir string) bool {
func (Inspector) CheckDir(dir string) bool {
return utils.IsFile(filepath.Join(dir, LockfileName)) && utils.IsFile(filepath.Join(dir, "package.json"))
}

func (_PnpmInspector) InspectProject(ctx context.Context) error {
func (Inspector) InspectProject(ctx context.Context) error {
inspectionTask := model.UseInspectionTask(ctx)
dir := inspectionTask.Dir()
lockfilePath := filepath.Join(dir, LockfileName)
Expand All @@ -53,8 +53,8 @@ func (_PnpmInspector) InspectProject(ctx context.Context) error {
return nil
}

func (_PnpmInspector) SupportFeature(feature model.InspectorFeature) bool {
func (Inspector) SupportFeature(feature model.InspectorFeature) bool {
return false
}

var _ model.Inspector = (*_PnpmInspector)(nil)
var _ model.Inspector = (*Inspector)(nil)
9 changes: 9 additions & 0 deletions module/pnpm_init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package module

import (
"github.com/murphysecurity/murphysec/module/pnpm"
)

func init() {
Inspectors = append(Inspectors, &pnpm.Inspector{})
}

0 comments on commit 15d37c6

Please sign in to comment.