Read Executable from factory instead of from stdlib

This commit is contained in:
Mislav Marohnić 2021-03-04 13:41:50 +01:00
parent 98f1f5ec0d
commit cfbfb578f0

View file

@ -163,10 +163,7 @@ func main() {
newRelease := <-updateMessageChan
if newRelease != nil {
isHomebrew := false
if ghExe, err := os.Executable(); err == nil {
isHomebrew = isUnderHomebrew(ghExe)
}
isHomebrew := isUnderHomebrew(cmdFactory.Executable)
if isHomebrew && isRecentRelease(newRelease.PublishedAt) {
// do not notify Homebrew users before the version bump had a chance to get merged into homebrew-core
return