github.com/pengwynn/gh@v1.0.1-0.20140118055701-14327ca3942e/commands/update.go (about)

     1  package commands
     2  
     3  import (
     4  	"github.com/jingweno/gh/utils"
     5  	"os"
     6  )
     7  
     8  var cmdUpdate = &Command{
     9  	Run:   update,
    10  	Usage: "update",
    11  	Short: "Update gh",
    12  	Long: `Update gh to the latest version.
    13  
    14  Examples:
    15    git update
    16  `,
    17  }
    18  
    19  func init() {
    20  	CmdRunner.Use(cmdUpdate)
    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  }