From cfbfb578f07e329623d1bd5c0010a89bbf613e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 4 Mar 2021 13:41:50 +0100 Subject: [PATCH] Read `Executable` from factory instead of from stdlib --- cmd/gh/main.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/gh/main.go b/cmd/gh/main.go index e20452808..0934863fc 100644 --- a/cmd/gh/main.go +++ b/cmd/gh/main.go @@ -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