new autogenpb
This commit is contained in:
parent
8e315cc238
commit
cf2f07f273
1
argv.go
1
argv.go
|
@ -20,6 +20,7 @@ type args struct {
|
||||||
Release bool `arg:"--release" help:"build a release from the last git tag"`
|
Release bool `arg:"--release" help:"build a release from the last git tag"`
|
||||||
KeepFiles bool `arg:"--keep-files" help:"keep the build files/"`
|
KeepFiles bool `arg:"--keep-files" help:"keep the build files/"`
|
||||||
Force bool `arg:"--force" default:"false" help:"force overwrite an existing .deb file"`
|
Force bool `arg:"--force" default:"false" help:"force overwrite an existing .deb file"`
|
||||||
|
Verbose bool `arg:"--verbose" help:"show more things"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -69,20 +69,36 @@ func (c *controlBox) buildPackage() (bool, error) {
|
||||||
return false, errors.New("binary existed before build")
|
return false, errors.New("binary existed before build")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
forgecmd := "forge"
|
forgecmd := "forge"
|
||||||
if argv.Forge == "go.wit.com/apps/forge" {
|
if argv.Forge == "go.wit.com/apps/forge" {
|
||||||
forgecmd = "last.forge"
|
forgecmd = "last.forge"
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if argv.Release {
|
if argv.Release {
|
||||||
os.Unsetenv("GO111MODULE")
|
os.Unsetenv("GO111MODULE")
|
||||||
cmd := []string{forgecmd, "--verbose", "--install", argv.Forge}
|
// cmd := []string{forgecmd, "--verbose", "--install", argv.Forge}
|
||||||
|
cmd := []string{"go"}
|
||||||
|
cmd = append(cmd, "install")
|
||||||
|
if argv.Verbose {
|
||||||
|
cmd = append(cmd, "-v")
|
||||||
|
cmd = append(cmd, "-x")
|
||||||
|
}
|
||||||
|
cmd = append(cmd, argv.Forge + "@v" + version)
|
||||||
if err := shell.PathExecVerbose("", cmd); err != nil {
|
if err := shell.PathExecVerbose("", cmd); err != nil {
|
||||||
badExit(err)
|
badExit(err)
|
||||||
return false, fmt.Errorf("go build err %v", err)
|
return false, fmt.Errorf("go build err %v", err)
|
||||||
}
|
}
|
||||||
// must 'go install' then 'go build' so they are both in ~/go/src and in the repo dir
|
// must 'go install' then 'go build' so they are both in ~/go/src and in the repo dir
|
||||||
cmd = []string{forgecmd, "--verbose", "--build", argv.Forge}
|
// cmd = []string{forgecmd, "--verbose", "--build", argv.Forge}
|
||||||
|
cmd = []string{"go"}
|
||||||
|
cmd = append(cmd, "build")
|
||||||
|
if argv.Verbose {
|
||||||
|
cmd = append(cmd, "-v")
|
||||||
|
cmd = append(cmd, "-x")
|
||||||
|
}
|
||||||
|
cmd = append(cmd, argv.Forge)
|
||||||
if err := shell.PathExecVerbose("", cmd); err != nil {
|
if err := shell.PathExecVerbose("", cmd); err != nil {
|
||||||
badExit(err)
|
badExit(err)
|
||||||
return false, fmt.Errorf("go build err %v", err)
|
return false, fmt.Errorf("go build err %v", err)
|
||||||
|
|
Loading…
Reference in New Issue