Skip to content

Allow update for dev #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove useless function
  • Loading branch information
matteosuppo committed Apr 11, 2016
commit 82a4b4ef401210dd4ec2df34b5bb6da360286d70
35 changes: 13 additions & 22 deletions updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,20 @@ type Updater struct {
// BackgroundRun starts the update check and apply cycle.
func (u *Updater) BackgroundRun() error {
os.MkdirAll(u.getExecRelativeDir(u.Dir), 0777)
if u.wantUpdate() {
if err := up.CanUpdate(); err != nil {
log.Println(err)
return err
}
//self, err := osext.Executable()
//if err != nil {
// fail update, couldn't figure out path to self
//return
//}
// TODO(bgentry): logger isn't on Windows. Replace w/ proper error reports.
if err := u.update(); err != nil {
return err
}
if err := up.CanUpdate(); err != nil {
log.Println(err)
return err
}
return errors.New("Won't update because it's a development daemon. Change the version in main.go")
//self, err := osext.Executable()
//if err != nil {
// fail update, couldn't figure out path to self
//return
//}
// TODO(bgentry): logger isn't on Windows. Replace w/ proper error reports.
if err := u.update(); err != nil {
return err
}
return nil
}

func fetch(url string) (io.ReadCloser, error) {
Expand Down Expand Up @@ -254,10 +252,3 @@ func (u *Updater) update() error {

return nil
}

func (u *Updater) wantUpdate() bool {
// if strings.Contains(u.CurrentVersion, "dev") {
// return false
// }
return true
}