Skip to content

Commit abf76c0

Browse files
committed
fix(npm): skip NPM inspection when found some lock files
1 parent a237148 commit abf76c0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

module/npm/npm.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import (
55
"context"
66
"errors"
77
"fmt"
8+
"os"
9+
"os/exec"
10+
"path/filepath"
11+
812
"github.com/murphysecurity/murphysec/env"
913
"github.com/murphysecurity/murphysec/infra/logctx"
1014
"github.com/murphysecurity/murphysec/model"
1115
"github.com/murphysecurity/murphysec/utils"
1216
"go.uber.org/zap"
13-
"os"
14-
"os/exec"
15-
"path/filepath"
1617
)
1718

1819
type Inspector struct{}
@@ -43,6 +44,12 @@ func (Inspector) CheckDir(ctx context.Context, dir string) bool {
4344
if utils.IsFile(filepath.Join(dir, "pnpm-lock.yaml")) {
4445
return false
4546
}
47+
if utils.IsFile(filepath.Join(dir, "pnpm-lock.aml")) {
48+
return false
49+
}
50+
if utils.IsFile(filepath.Join(dir, "oh-package-lock.json5")) {
51+
return false
52+
}
4653

4754
return true
4855
}

0 commit comments

Comments
 (0)