mirror of
https://github.com/wahyd4/forego.git
synced 2026-08-09 05:07:05 +10:00
37 lines
569 B
Go
37 lines
569 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/ddollar/forego/Godeps/_workspace/src/github.com/ddollar/dist"
|
|
)
|
|
|
|
var cmdUpdate = &Command{
|
|
Run: runUpdate,
|
|
Usage: "update",
|
|
Short: "Update forego",
|
|
Long: `
|
|
Update forego
|
|
|
|
Examples:
|
|
|
|
forego update
|
|
`,
|
|
}
|
|
|
|
func init() {
|
|
}
|
|
|
|
func runUpdate(cmd *Command, args []string) {
|
|
if Version == "dev" {
|
|
fmt.Println("ERROR: can't update dev version")
|
|
return
|
|
}
|
|
d := dist.NewDist("ddollar/forego", Version)
|
|
to, err := d.Update()
|
|
if err != nil {
|
|
fmt.Printf("ERROR: %s\n", err)
|
|
} else {
|
|
fmt.Printf("updated to %s\n", to)
|
|
}
|
|
}
|