@@ -12,13 +12,12 @@ import (
12
12
"os"
13
13
"path/filepath"
14
14
"runtime"
15
- "strings"
16
15
"time"
17
16
18
17
log "github.com/Sirupsen/logrus"
18
+ "github.com/inconshreveable/go-update"
19
19
"github.com/kr/binarydist"
20
20
21
- "github.com/inconshreveable/go-update"
22
21
"github.com/kardianos/osext"
23
22
)
24
23
@@ -90,22 +89,20 @@ type Updater struct {
90
89
// BackgroundRun starts the update check and apply cycle.
91
90
func (u * Updater ) BackgroundRun () error {
92
91
os .MkdirAll (u .getExecRelativeDir (u .Dir ), 0777 )
93
- if u .wantUpdate () {
94
- if err := up .CanUpdate (); err != nil {
95
- log .Println (err )
96
- return err
97
- }
98
- //self, err := osext.Executable()
99
- //if err != nil {
100
- // fail update, couldn't figure out path to self
101
- //return
102
- //}
103
- // TODO(bgentry): logger isn't on Windows. Replace w/ proper error reports.
104
- if err := u .update (); err != nil {
105
- return err
106
- }
92
+ if err := up .CanUpdate (); err != nil {
93
+ log .Println (err )
94
+ return err
95
+ }
96
+ //self, err := osext.Executable()
97
+ //if err != nil {
98
+ // fail update, couldn't figure out path to self
99
+ //return
100
+ //}
101
+ // TODO(bgentry): logger isn't on Windows. Replace w/ proper error reports.
102
+ if err := u .update (); err != nil {
103
+ return err
107
104
}
108
- return errors . New ( "Won't update because it's a development daemon. Change the version in main.go" )
105
+ return nil
109
106
}
110
107
111
108
func fetch (url string ) (io.ReadCloser , error ) {
@@ -255,10 +252,3 @@ func (u *Updater) update() error {
255
252
256
253
return nil
257
254
}
258
-
259
- func (u * Updater ) wantUpdate () bool {
260
- if strings .Contains (u .CurrentVersion , "dev" ) {
261
- return false
262
- }
263
- return true
264
- }
0 commit comments