Commit 7aaa1884 by Mario Trangoni

build.go: fix deadcode issues

parent 44a61a6d
...@@ -16,7 +16,6 @@ import ( ...@@ -16,7 +16,6 @@ import (
"os/exec" "os/exec"
"path" "path"
"path/filepath" "path/filepath"
"regexp"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
...@@ -24,7 +23,7 @@ import ( ...@@ -24,7 +23,7 @@ import (
) )
var ( var (
versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`) //versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`)
goarch string goarch string
goos string goos string
gocc string gocc string
...@@ -44,14 +43,14 @@ var ( ...@@ -44,14 +43,14 @@ var (
isDev bool = false isDev bool = false
) )
const minGoVersion = 1.8
func main() { func main() {
log.SetOutput(os.Stdout) log.SetOutput(os.Stdout)
log.SetFlags(0) log.SetFlags(0)
ensureGoPath() ensureGoPath()
verifyGitRepoIsClean()
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH") flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS") flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
flag.StringVar(&gocc, "cc", "", "CC") flag.StringVar(&gocc, "cc", "", "CC")
...@@ -352,10 +351,6 @@ func ensureGoPath() { ...@@ -352,10 +351,6 @@ func ensureGoPath() {
} }
} }
func ChangeWorkingDir(dir string) {
os.Chdir(dir)
}
func grunt(params ...string) { func grunt(params ...string) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
runPrint(`.\node_modules\.bin\grunt`, params...) runPrint(`.\node_modules\.bin\grunt`, params...)
...@@ -492,24 +487,6 @@ func buildStamp() int64 { ...@@ -492,24 +487,6 @@ func buildStamp() int64 {
return s return s
} }
func buildArch() string {
os := goos
if os == "darwin" {
os = "macosx"
}
return fmt.Sprintf("%s-%s", os, goarch)
}
func run(cmd string, args ...string) []byte {
bs, err := runError(cmd, args...)
if err != nil {
log.Println(cmd, strings.Join(args, " "))
log.Println(string(bs))
log.Fatal(err)
}
return bytes.TrimSpace(bs)
}
func runError(cmd string, args ...string) ([]byte, error) { func runError(cmd string, args ...string) ([]byte, error) {
ecmd := exec.Command(cmd, args...) ecmd := exec.Command(cmd, args...)
bs, err := ecmd.CombinedOutput() bs, err := ecmd.CombinedOutput()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment