Merge pull request #1714 from dnephin/remove-deadcode-from-release

Remove deadcode from cmd/containerd-release
This commit is contained in:
Stephen Day 2017-11-02 16:57:16 -07:00 committed by GitHub
commit 99595e0b84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 45 deletions

View File

@ -1,44 +0,0 @@
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"os"
"os/exec"
"runtime"
"strings"
)
func build() error {
out, err := exec.Command("make").CombinedOutput()
if err != nil {
return fmt.Errorf("%s: %s", err, out)
}
return nil
}
const tarFormat = "%s-%s.%s-%s.tar.gz"
func tarRelease(projectName, tag string) (string, error) {
path := fmt.Sprintf(tarFormat, strings.ToLower(projectName), tag, runtime.GOOS, runtime.GOARCH)
out, err := exec.Command("tar", "-zcf", path, "bin/").CombinedOutput()
if err != nil {
return "", fmt.Errorf("%s: %s", err, out)
}
return path, nil
}
func hash(path string) (string, error) {
f, err := os.Open(path)
if err != nil {
return "", err
}
defer f.Close()
s := sha256.New()
if _, err := io.Copy(s, f); err != nil {
return "", err
}
return hex.EncodeToString(s.Sum(nil)), nil
}

View File

@ -121,7 +121,7 @@ This tool should be ran from the root of the project repository for a new releas
return nil return nil
} }
if err := app.Run(os.Args); err != nil { if err := app.Run(os.Args); err != nil {
fmt.Fprint(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
os.Exit(1) os.Exit(1)
} }
} }