Skip to content

Commit

Permalink
Don't print version update message if plain flag is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccirello committed Dec 12, 2019
1 parent 330359c commit 79752b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ var rootCmd = &cobra.Command{
// disable version checking on the "run" command
if version.PerformVersionCheck && cmd.CalledAs() != "run" {
silent := utils.GetBoolFlagIfChanged(cmd, "silent", false)
plain := utils.GetBoolFlagIfChanged(cmd, "plain", false)

versionCheck := http.CheckCLIVersion(configuration.VersionCheck(), silent, utils.OutputJSON, utils.Debug)
if versionCheck != (models.VersionCheck{}) {
shouldPrint := utils.Debug || (!silent && !utils.OutputJSON)
shouldPrint := utils.Debug || (!silent && !plain && !utils.OutputJSON)
if version.ProgramVersion != versionCheck.LatestVersion && shouldPrint {
fmt.Printf("Doppler CLI version %s is now available\n", versionCheck.LatestVersion)
}
Expand Down

0 comments on commit 79752b1

Please sign in to comment.