Add APP_ENV var
This commit is contained in:
parent
49d5ada937
commit
d69f58cd6b
2 changed files with 10 additions and 0 deletions
1
.github/workflows/releases.yml
vendored
1
.github/workflows/releases.yml
vendored
|
|
@ -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}}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue