Consider grep return value 1 as success (#907)

* Allow Offline scanning on Alpine

* Consider grep return value 1 as success
This commit is contained in:
Wagde Zabit
2019-09-18 17:26:37 +03:00
committed by Kota Kanbe
parent b2e429ccc6
commit 45bff26558

View File

@@ -555,7 +555,7 @@ func (l *base) scanLibraries() (err error) {
// find / -name "*package-lock.json" -o -name "*yarn.lock" ... 2>&1 | grep -v "Permission denied"
cmd := fmt.Sprintf(`find / ` + findopt[:len(findopt)-3] + ` 2>&1 | grep -v "Permission denied"`)
r := exec(l.ServerInfo, cmd, noSudo)
if !r.isSuccess() {
if r.ExitStatus != 0 && r.ExitStatus != 1 {
return xerrors.Errorf("Failed to find lock files")
}
detectFiles = append(detectFiles, strings.Split(r.Stdout, "\n")...)