Remove deadcode from cmd/containerd-release
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
5acf187697
commit
393e8cc332
@ -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
|
||||
}
|
@ -121,7 +121,7 @@ This tool should be ran from the root of the project repository for a new releas
|
||||
return nil
|
||||
}
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
fmt.Fprint(os.Stderr, err)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user