From 45bff2655893a56bb81586a41d30400db632243d Mon Sep 17 00:00:00 2001 From: Wagde Zabit <32863274+wagdez@users.noreply.github.com> Date: Wed, 18 Sep 2019 17:26:37 +0300 Subject: [PATCH] Consider grep return value 1 as success (#907) * Allow Offline scanning on Alpine * Consider grep return value 1 as success --- scan/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan/base.go b/scan/base.go index e61b6596..bd56ac1f 100644 --- a/scan/base.go +++ b/scan/base.go @@ -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")...)