From d69f58cd6bc956749f1c865bd7932ae6b2a537a1 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 22 Nov 2019 13:48:06 -0800 Subject: [PATCH] Add APP_ENV var --- .github/workflows/releases.yml | 1 + update/checkForUpdate.go | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 2a5b327ad..a17dc363b 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -22,6 +22,7 @@ jobs: version: latest args: release env: + APP_ENV: production GH_OAUTH_CLIENT_ID: 178c6fc778ccc68e1d6a GH_OAUTH_CLIENT_SECRET: ${{secrets.OAUTH_CLIENT_SECRET}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/update/checkForUpdate.go b/update/checkForUpdate.go index 807c43d56..ce2af8423 100644 --- a/update/checkForUpdate.go +++ b/update/checkForUpdate.go @@ -20,13 +20,22 @@ type releaseInfo struct { } func CheckForUpdate(handleUpdate chan func()) { + // Only check for updates in production + if os.Getenv("APP_ENV") != "production" { + handleUpdate <- nil + return + } + + // Ignore if this stdout is not a tty if !terminal.IsTerminal(int(os.Stdout.Fd())) { handleUpdate <- nil + return } latestRelease, err := getLatestRelease() if err != nil { handleUpdate <- nil + return } updateAvailable := latestRelease.Version != command.Version