Skip to content

Commit

Permalink
refactor: rename EnableUpdateChecking to DisableUpdateChecking
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed May 30, 2021
1 parent 1758482 commit 44a2d23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

var rootCmd *cobra.Command

// EnableUpdateChecking automatically checks if a new version of your application is pushed, and notifies the user.
var EnableUpdateChecking = true
// DisableUpdateChecking automatically checks if a new version of your application is pushed, and notifies the user.
var DisableUpdateChecking = false

// SetRootCmd sets your rootCmd.
func SetRootCmd(cmd *cobra.Command) {
Expand All @@ -37,9 +37,9 @@ func Setup() {
rootCmd.SetErr(Err())
}

// CheckForUpdates checks if a new version of your application is pushed, and notifies the user, if EnableUpdateChecking is true.
// CheckForUpdates checks if a new version of your application is pushed, and notifies the user, if DisableUpdateChecking is true.
func CheckForUpdates() error {
if EnableUpdateChecking {
if !DisableUpdateChecking {
resp, err := http.Get(pterm.Sprintf("https://api.github.com/repos/%s/releases/latest", getRepoPath()))
if err != nil {
return err
Expand Down

0 comments on commit 44a2d23

Please sign in to comment.