summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--argv.go45
-rw-r--r--buildPackage.go10
-rw-r--r--main.go6
4 files changed, 36 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index d2d79c7..b8d7d32 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,11 @@
VERSION = $(shell git describe --tags)
DATE = $(shell date +%Y.%m.%d)
-run: install
- go-deb --release --no-gui --auto --forge go.wit.com/apps/autogenpb --dir ${HOME}/incoming
- go-deb --release --no-gui --auto --forge go.wit.com/apps/go-mod-clean --dir ${HOME}/incoming
+run: clean goimports vet install
+ go-deb --release --no-gui --auto --forge go.wit.com/apps/autogenpb --dir /tmp/
+ go-deb --release --no-gui --auto --forge go.wit.com/apps/go-mod-clean --dir /tmp/
@#go-deb --forge go.wit.com/apps/autotypist --no-gui --auto
- ls -lth ${HOME}/incoming
+ ls -lth /tmp/*deb
vet:
@GO111MODULE=off go vet
@@ -47,6 +47,7 @@ nocui: reset build
./go-deb --gui nocui
clean:
+ rm -f go.*
rm -f go-deb
rm -f resources/*.so
touch resources/blank.so
diff --git a/argv.go b/argv.go
index 9e89aeb..f20cb89 100644
--- a/argv.go
+++ b/argv.go
@@ -6,35 +6,30 @@ package main
this enables command line options from other packages like 'gui' and 'log'
*/
-import (
- "go.wit.com/dev/alexflint/arg"
-)
-
-var argv args
-
type args struct {
- Auto bool `arg:"--auto" help:"automatically attempt to make the .deb"`
- Ldflags []string `arg:"--ldflags" help:"flags to pass to go build"`
- Forge string `arg:"--forge" help:"use a git repo from forge"`
- OutDir string `arg:"--dir" help:"write .deb file into this directory"`
- Release bool `arg:"--release" help:"build a release from the last git tag"`
- KeepFiles bool `arg:"--keep-files" help:"keep the build files/"`
- Force bool `arg:"--force" default:"false" help:"force overwrite an existing .deb file"`
- Verbose bool `arg:"--verbose" help:"show more things"`
+ Commit *EmptyCmd `arg:"subcommand:commit" help:"'git commit' but errors out if on wrong branch"`
+ Auto bool `arg:"--auto" help:"automatically attempt to make the .deb"`
+ Ldflags []string `arg:"--ldflags" help:"flags to pass to go build"`
+ Forge string `arg:"--forge" help:"use a git repo from forge"`
+ OutDir string `arg:"--dir" help:"write .deb file into this directory"`
+ Release bool `arg:"--release" help:"build a release from the last git tag"`
+ KeepFiles bool `arg:"--keep-files" help:"keep the build files/"`
+ Force bool `arg:"--force" default:"false" help:"force overwrite an existing .deb file"`
+ Verbose bool `arg:"--verbose" help:"show more things"`
}
-func init() {
- arg.MustParse(&argv)
+func (args) Version() string {
+ return "go-clone " + VERSION + " Built on " + DATE
+}
- /*
- if debugger.ArgDebug() {
- log.Info("cmd line --debugger == true")
- } else {
- log.Info("cmd line --debugger == false")
- }
- */
+type EmptyCmd struct {
}
-func (args) Version() string {
- return "go-clone " + VERSION + " Built on " + DATE
+func (a args) Description() string {
+ return `
+Example usage:
+ guireleaser go.wit.com/apps/go-clone --increment --release --dry-run --reason "blerg"
+
+This will pull down the go sources and
+the repositories in the go.sum file using git clone`
}
diff --git a/buildPackage.go b/buildPackage.go
index a8d2c55..b57dcfe 100644
--- a/buildPackage.go
+++ b/buildPackage.go
@@ -70,10 +70,10 @@ func (c *controlBox) buildPackage() (bool, error) {
}
/*
- forgecmd := "forge"
- if argv.Forge == "go.wit.com/apps/forge" {
- forgecmd = "last.forge"
- }
+ forgecmd := "forge"
+ if argv.Forge == "go.wit.com/apps/forge" {
+ forgecmd = "last.forge"
+ }
*/
if argv.Release {
@@ -85,7 +85,7 @@ func (c *controlBox) buildPackage() (bool, error) {
cmd = append(cmd, "-v")
cmd = append(cmd, "-x")
}
- cmd = append(cmd, argv.Forge + "@v" + version)
+ cmd = append(cmd, argv.Forge+"@v"+version)
if err := shell.PathExecVerbose("", cmd); err != nil {
badExit(err)
return false, fmt.Errorf("go build err %v", err)
diff --git a/main.go b/main.go
index 9f62d3f..eae053b 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,7 @@ import (
"os"
"path/filepath"
+ "go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
"go.wit.com/lib/fhelp"
"go.wit.com/lib/gui/shell"
@@ -19,9 +20,14 @@ var DATE string
//go:embed resources/*
var resources embed.FS
+var argv args
+
func main() {
me = new(mainType)
+ gui.InitArg()
+ arg.MustParse(&argv)
+
goSrc, hasWork, err := fhelp.DetermineGoPath()
if err != nil {
badExit(err)