From c5ca824dd50aa3f04b0c7c8e9d0008cf856b3dc7 Mon Sep 17 00:00:00 2001 From: Tony Worm Date: Thu, 14 May 2020 00:59:55 -0600 Subject: [PATCH] bump cli version for update fix --- .hof/Cli/cmd/hof/cmd/root.go | 2 +- .hof/Cli/cmd/hof/cmd/update.go | 6 +++++- cmd/hof/cmd/root.go | 2 +- cmd/hof/cmd/update.go | 6 +++++- cue.mods | 2 +- cue.sums | 2 ++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.hof/Cli/cmd/hof/cmd/root.go b/.hof/Cli/cmd/hof/cmd/root.go index a5d58f7ab..8b7072b70 100644 --- a/.hof/Cli/cmd/hof/cmd/root.go +++ b/.hof/Cli/cmd/hof/cmd/root.go @@ -35,7 +35,7 @@ func RootPersistentPreRun(args []string) (err error) { func RootPersistentPostRun(args []string) (err error) { - PrintUpdateAvailable() + WaitPrintUpdateAvailable() return err } diff --git a/.hof/Cli/cmd/hof/cmd/update.go b/.hof/Cli/cmd/hof/cmd/update.go index 9afd53e81..2c8460a5c 100644 --- a/.hof/Cli/cmd/hof/cmd/update.go +++ b/.hof/Cli/cmd/hof/cmd/update.go @@ -72,6 +72,7 @@ var UpdateCmd = &cobra.Command{ return } else { if UpdateCheckFlag { + PrintUpdateAvailable() return } } @@ -180,7 +181,10 @@ func CheckUpdate(manual bool) (ver ProgramVersion, err error) { return ver, nil } -func WaitPrintUpdateAvail() { +func WaitPrintUpdateAvailable() { + if os.Getenv("HOF_UPDATES_DISABLED") != "" { + return + } for i := 0; i < 20 && !UpdateStarted && !UpdateChecked && !UpdateErrored; i++ { time.Sleep(50 * time.Millisecond) } diff --git a/cmd/hof/cmd/root.go b/cmd/hof/cmd/root.go index a5d58f7ab..8b7072b70 100644 --- a/cmd/hof/cmd/root.go +++ b/cmd/hof/cmd/root.go @@ -35,7 +35,7 @@ func RootPersistentPreRun(args []string) (err error) { func RootPersistentPostRun(args []string) (err error) { - PrintUpdateAvailable() + WaitPrintUpdateAvailable() return err } diff --git a/cmd/hof/cmd/update.go b/cmd/hof/cmd/update.go index 9afd53e81..2c8460a5c 100644 --- a/cmd/hof/cmd/update.go +++ b/cmd/hof/cmd/update.go @@ -72,6 +72,7 @@ var UpdateCmd = &cobra.Command{ return } else { if UpdateCheckFlag { + PrintUpdateAvailable() return } } @@ -180,7 +181,10 @@ func CheckUpdate(manual bool) (ver ProgramVersion, err error) { return ver, nil } -func WaitPrintUpdateAvail() { +func WaitPrintUpdateAvailable() { + if os.Getenv("HOF_UPDATES_DISABLED") != "" { + return + } for i := 0; i < 20 && !UpdateStarted && !UpdateChecked && !UpdateErrored; i++ { time.Sleep(50 * time.Millisecond) } diff --git a/cue.mods b/cue.mods index 6dcd8db98..ad3a169fb 100644 --- a/cue.mods +++ b/cue.mods @@ -3,6 +3,6 @@ module github.com/hofstadter-io/hof cue master require ( - github.com/hofstadter-io/hofmod-cli v0.5.5 + github.com/hofstadter-io/hofmod-cli v0.5.6 github.com/hofstadter-io/mvs v0.7.6 ) diff --git a/cue.sums b/cue.sums index 2cca36aaf..e10a1f7eb 100644 --- a/cue.sums +++ b/cue.sums @@ -18,6 +18,8 @@ github.com/hofstadter-io/hofmod-cli v0.5.4 h1:bO72JKO70dnmRBOV/c9IbTXQZuhsParhuw github.com/hofstadter-io/hofmod-cli v0.5.4/cue.mods h1:8TVLRMLOvfcVRZu6NqDr4VFmvuw/9Ca7YpCMo1fTRmU= github.com/hofstadter-io/hofmod-cli v0.5.5 h1:U39psc0wrKEEdYiNZ5+9b+50PyxFLCeQ7b3mC64SBas= github.com/hofstadter-io/hofmod-cli v0.5.5/cue.mods h1:8TVLRMLOvfcVRZu6NqDr4VFmvuw/9Ca7YpCMo1fTRmU= +github.com/hofstadter-io/hofmod-cli v0.5.6 h1:o64aCgzhH62fZvpa2uK+bENIfXrEcMHfXCHuMJTxoFw= +github.com/hofstadter-io/hofmod-cli v0.5.6/cue.mods h1:8TVLRMLOvfcVRZu6NqDr4VFmvuw/9Ca7YpCMo1fTRmU= github.com/hofstadter-io/mvs v0.0.0 h1:/rMWV7c92qpH/hyl8Ibi/DSUhrGDgDeKBtFkZeD+SMo= github.com/hofstadter-io/mvs v0.0.0/cue.mods h1:Bt+zMXYlsncBuI+lyMWfRLObqOt+HNOCAO/DDh1Mf+M= github.com/hofstadter-io/mvs v0.4.4 h1:hw65QjfvxPjeUimqurEbTuwnDLSj/GUABKsHUymaW2g=