Skip to content

Commit

Permalink
Merge pull request #31 from sonatype-nexus-community/DetectorFix
Browse files Browse the repository at this point in the history
Detector fix
  • Loading branch information
zendern authored Aug 15, 2020
2 parents 4279556 + 7cd9d9a commit fb9c355
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ahab
ahab.exe
vendor
.DS_Store
.vscode
Expand Down
23 changes: 6 additions & 17 deletions packages/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,12 @@ func determineIfPackageManagerInstalled(packageManager string, logger *logrus.Lo
if exitError, ok := err.(*exec.ExitError); ok {
waitStatus = exitError.Sys().(syscall.WaitStatus)
logger.Infof("Output 1: %s\n", []byte(fmt.Sprintf("%d", waitStatus.ExitStatus())))
if waitStatus == 0 {
return true
}else{
return false
}
}else{
return false
}
} else {
// Success
waitStatus = cmd.ProcessState.Sys().(syscall.WaitStatus)
logger.Info(string(output))
logger.Infof("Output 2: %s\n", []byte(fmt.Sprintf("%d", waitStatus.ExitStatus())))
if waitStatus == 0 {
return true
}else{
return false
return waitStatus.ExitStatus() == 0
}
return false
}
waitStatus = cmd.ProcessState.Sys().(syscall.WaitStatus)
logger.Info(string(output))
logger.Infof("Output 2: %s\n", []byte(fmt.Sprintf("%d", waitStatus.ExitStatus())))
return waitStatus.ExitStatus() == 0
}

0 comments on commit fb9c355

Please sign in to comment.