Skip to content

Commit

Permalink
go format
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-cbon committed Aug 15, 2016
1 parent 69d1f42 commit e87f04d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
14 changes: 12 additions & 2 deletions change.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@

UNRELEASED

* appveyor: update choco push key
* choco: add checksum support. Closes #1
* choco: fix pack command invokation, it was colliding with cmake

- mh-cbon <mh-cbon@users.noreply.github.com>

-- mh-cbon <mh-cbon@users.noreply.github.com>; Mon, 15 Aug 2016 18:30:01 +0200



0.0.38

* choco: ensure tags always contains admin value to pass chocolatey validation
Expand Down Expand Up @@ -418,5 +430,3 @@
- mh-cbon <mh-cbon@users.noreply.github.com>

-- mh-cbon <mh-cbon@users.noreply.github.com>; Sat, 25 Jun 2016 19:55:56 +0200


6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,9 @@ func chocoMake(c *cli.Context) error {
wixFile.Choco.BuildDir = out
wixFile.Choco.MsiFile = filepath.Base(input)
wixFile.Choco.MsiSum, err = util.ComputeSha256(input)
if err != nil {
return cli.NewExitError(err.Error(), 1)
}
if err != nil {
return cli.NewExitError(err.Error(), 1)
}

if changelogCmd != "" {
windows, err := stringexec.Command(changelogCmd)
Expand Down
24 changes: 12 additions & 12 deletions util/index.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package util

import (
"crypto/sha256"
"encoding/hex"
"io"
"os"
"os/exec"
"path/filepath"
"encoding/hex"
"crypto/sha256"
)

// Find path of the current binary file on the file system
Expand Down Expand Up @@ -43,14 +43,14 @@ func CopyFile(dst, src string) error {
}

func ComputeSha256(filepath string) (string, error) {
hasher := sha256.New()
f, err := os.Open(filepath)
if err != nil {
return "", err
}
defer f.Close()
if _, err := io.Copy(hasher, f); err != nil {
return "", err
}
return hex.EncodeToString(hasher.Sum(nil)), nil
hasher := sha256.New()
f, err := os.Open(filepath)
if err != nil {
return "", err
}
defer f.Close()
if _, err := io.Copy(hasher, f); err != nil {
return "", err
}
return hex.EncodeToString(hasher.Sum(nil)), nil
}

0 comments on commit e87f04d

Please sign in to comment.