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

Commit

Permalink
Use CombinedOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel committed Apr 8, 2016
1 parent 8cc084f commit 7864cd7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions updater_osx.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func (u *Updater) checkPlatformSpecificUpdate(sourcePath string, destinationPath

func (u *Updater) openApplication(applicationPath string) error {
tryOpen := func() error {
out, err := exec.Command("/usr/bin/open", applicationPath).Output()
out, err := exec.Command("/usr/bin/open", applicationPath).CombinedOutput()
if err != nil {
return fmt.Errorf("%s; %s", err, out)
return fmt.Errorf("%s; %s", err, string(out))
}
return nil
}
Expand All @@ -94,9 +94,9 @@ func (u *Updater) applyUpdate(localPath string) (err error) {

// Update spotlight, ignore (but log) errors
u.log.Debug("Updating spotlight: %s", destinationPath)
mdimportOut, mdierr := exec.Command("/usr/bin/mdimport", destinationPath).Output()
mdimportOut, mdierr := exec.Command("/usr/bin/mdimport", destinationPath).CombinedOutput()
if mdierr != nil {
u.log.Errorf("Error trying to update spotlight: %s; %s", mdierr, mdimportOut)
u.log.Errorf("Error trying to update spotlight: %s; %s", mdierr, string(mdimportOut))
}
return
}

0 comments on commit 7864cd7

Please sign in to comment.