mirror of
https://github.com/wahyd4/forego.git
synced 2026-08-09 05:07:05 +10:00
update dist
This commit is contained in:
Generated
+2
-2
@@ -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",
|
||||
|
||||
+14
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user