Skip to content

Commit

Permalink
feat(cli): use checkVersion function
Browse files Browse the repository at this point in the history
This commit modifies the main.go and cli.go files to use the previously defined CheckVersion function. Now, whenever the main function is called, it automatically checks for available updates and prompts the user for an update.
  • Loading branch information
dikkadev committed Apr 12, 2023
1 parent 3b1f2e8 commit 08b870f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func CheckVersion() {
onlineVersion := strings.TrimPrefix(release.TagName, "v")

if onlineVersion != globals.Version {
fmt.Printf("A new version (%s) of mdpaper is available! Run 'go install github.com/Sett17/mdpaper/v2@{%s}' to update.\n", release.TagName, release.TagName)
fmt.Printf("A new version (%s) of mdpaper is available! Run \ngo install github.com/Sett17/mdpaper/v2@{%s}\n to update.\n", release.TagName, release.TagName)
}
}

Expand Down
2 changes: 1 addition & 1 deletion globals/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package globals

const Version = "2.7.5"
const Version = "2.7.6"
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,5 @@ func main() {

cli.Warning("Please look over the PDF yourself and make sure that it is correct.\nmdpaper is not responsible for the correctness of the output.")
println()
cli.CheckVersion()
}

0 comments on commit 08b870f

Please sign in to comment.