mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 20:37:05 +00:00
Update to 8.3.0 | MVC Models and Bindings and fix of #723 , read HISTORY.md
Former-commit-id: d8f66d8d370c583a288333df2a14c6ee2dc56466
This commit is contained in:
17
version.go
17
version.go
@@ -7,7 +7,6 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -15,11 +14,6 @@ import (
|
||||
"github.com/kataras/iris/core/netutil"
|
||||
)
|
||||
|
||||
const (
|
||||
versionURL = "http://iris-go.com/version"
|
||||
updateCmd = "go get -u -f -v github.com/kataras/iris"
|
||||
)
|
||||
|
||||
var checkVersionOnce = sync.Once{}
|
||||
|
||||
// CheckVersion checks for any available updates.
|
||||
@@ -36,8 +30,8 @@ type versionInfo struct {
|
||||
}
|
||||
|
||||
func checkVersion() {
|
||||
client := netutil.Client(time.Duration(20 * time.Second))
|
||||
r, err := client.PostForm(versionURL, url.Values{"current_version": {Version}})
|
||||
client := netutil.Client(20 * time.Second)
|
||||
r, err := client.PostForm("http://iris-go.com/version", url.Values{"current_version": {Version}})
|
||||
|
||||
if err != nil {
|
||||
golog.Debugf("%v", err)
|
||||
@@ -105,9 +99,8 @@ func checkVersion() {
|
||||
}
|
||||
|
||||
if shouldUpdate {
|
||||
goget := strings.Split(updateCmd, " ")
|
||||
// go get -u github.com/:owner/:repo
|
||||
cmd := exec.Command(goget[0], goget[1:]...)
|
||||
repo := "github.com/kataras/iris"
|
||||
cmd := exec.Command("go", "get", "-u", "-f", "-v", repo)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stdout
|
||||
|
||||
@@ -116,6 +109,6 @@ func checkVersion() {
|
||||
return
|
||||
}
|
||||
|
||||
golog.Infof("Update process finished.\nManual restart is required to apply the changes...")
|
||||
golog.Infof("Update process finished.\nManual rebuild and restart is required to apply the changes...")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user