Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Apply, stop then start
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel committed Mar 10, 2017
1 parent 5c38715 commit 9d12da6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion keybase/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (c context) BeforeApply(update updater.Update) error {
return fmt.Errorf("Canceled by user from paused prompt")
}
}
return c.beforeApply(update)
return nil
}

func (c context) AfterUpdateCheck(update *updater.Update) {
Expand Down
11 changes: 4 additions & 7 deletions keybase/platform_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@ func (c context) lookupProcessPaths() (p processPaths, _ error) {
return p, nil
}

func (c context) beforeApply(update updater.Update) error {
if err := c.stop(); err != nil {
c.log.Warningf("Error trying to stop: %s", err)
}
return nil
}

// stop will quit the app and any services
func (c context) stop() error {
// Stop app
Expand Down Expand Up @@ -189,6 +182,10 @@ func (c context) stop() error {

// AfterApply is called after an update is applied
func (c context) AfterApply(update updater.Update) error {
if err := c.stop(); err != nil {
c.log.Warningf("Error trying to stop: %s", err)
}

if err := c.start(10*time.Second, time.Second); err != nil {
c.log.Warningf("Error trying to start the app: %s", err)
}
Expand Down
4 changes: 0 additions & 4 deletions keybase/platform_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ func (c context) PausedPrompt() bool {
return false
}

func (c context) beforeApply(update updater.Update) error {
return nil
}

func (c context) Apply(update updater.Update, options updater.UpdateOptions, tmpDir string) error {
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions keybase/platform_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ func (c context) PausedPrompt() bool {
return false
}

func (c context) beforeApply(update updater.Update) error {
return nil
}

func (c context) Apply(update updater.Update, options updater.UpdateOptions, tmpDir string) error {
if update.Asset == nil || update.Asset.LocalPath == "" {
return fmt.Errorf("No asset")
Expand Down

0 comments on commit 9d12da6

Please sign in to comment.