diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 1da8f31..f8ee407 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -13,8 +13,8 @@ }, { "ImportPath": "github.com/ddollar/dist", - "Comment": "v0.2.0", - "Rev": "95b3220dbc9bb70c4cbda93b4064655a1ff86a06" + "Comment": "v0.2.0-2-gf559761", + "Rev": "f559761fd36c52dc90d7d2c0bc537e6d96b0edc5" }, { "ImportPath": "github.com/ddollar/go-update", diff --git a/Godeps/_workspace/src/github.com/ddollar/dist/dist.go b/Godeps/_workspace/src/github.com/ddollar/dist/dist.go index c816c42..07d7007 100644 --- a/Godeps/_workspace/src/github.com/ddollar/dist/dist.go +++ b/Godeps/_workspace/src/github.com/ddollar/dist/dist.go @@ -2,7 +2,7 @@ package dist import ( - "github.com/ddollar/forego/Godeps/_workspace/src/bitbucket.org/kardianos/osext" + "bitbucket.org/kardianos/osext" "bytes" "crypto/tls" "crypto/x509" @@ -10,8 +10,8 @@ import ( "encoding/pem" "errors" "fmt" - "github.com/inconshreveable/go-update" - "github.com/ddollar/forego/Godeps/_workspace/src/github.com/kr/binarydist" + "github.com/ddollar/go-update" + "github.com/kr/binarydist" "io/ioutil" "net/http" "os" @@ -102,6 +102,17 @@ func (d *Dist) UpdateTo(to string) (err error) { return } +// Update to a specific version regardless of the starting version +func (d *Dist) FullUpdate(to string) (err error) { + url := fmt.Sprintf("%s/projects/%s/releases/%s/%s-%s/%s", d.Host, d.Project, to, runtime.GOOS, runtime.GOARCH, d.Name) + reader, err := d.httpGet(url) + if err != nil { + return err + } + err, _ = update.FromStream(bytes.NewReader(reader)) + return +} + func (d *Dist) fetchReleases() (releases []Release, err error) { body, err := d.httpGet(fmt.Sprintf("%s/projects/%s/releases/%s-%s", d.Host, d.Project, runtime.GOOS, runtime.GOARCH)) if err != nil {