github.com/jingweno/gh@v2.1.1-0.20221007190738-04a7985fa9a1+incompatible/commands/selfupdate.go (about) 1 package commands 2 3 import ( 4 "github.com/jingweno/gh/utils" 5 "os" 6 ) 7 8 var cmdSelfupdate = &Command{ 9 Run: update, 10 Usage: "selfupdate", 11 Short: "Update gh", 12 Long: `Update gh to the latest version. 13 14 Examples: 15 git selfupdate 16 `, 17 } 18 19 func init() { 20 CmdRunner.Use(cmdSelfupdate) 21 } 22 23 func update(cmd *Command, args *Args) { 24 updater := NewUpdater() 25 err := updater.Update() 26 utils.Check(err) 27 os.Exit(0) 28 }