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:
		@@ -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")...)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user