From 2141737e7c1efac1fe0cd929e4da5ad18397b43c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 16 Dec 2024 01:08:56 -0600 Subject: [PATCH] actually implement --dir --- README.md | 2 +- argv.go | 2 +- buildPackage.go | 7 ++++++- control | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 52916ff..ddb8413 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Makes a debian package from a go git repository, but also arbitrary things. -# Usage (puts the finished .deb file in ~/incoming/) : +# Usage * go-deb --auto --repo go.wit.com/apps/go-clone # just make the .deb file already * go-deb ---repo go.wit.com/apps/go-clone # will try to open a gtk gui diff --git a/argv.go b/argv.go index dab16cc..1ceb6cc 100644 --- a/argv.go +++ b/argv.go @@ -18,7 +18,7 @@ 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"` Repo string `arg:"--repo" help:"go get path to the repo"` - PkgDir string `arg:"--pkg-dir" help:"set default directory (~/incoming/)"` + 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"` diff --git a/buildPackage.go b/buildPackage.go index 17f8ffd..d717854 100644 --- a/buildPackage.go +++ b/buildPackage.go @@ -39,7 +39,12 @@ func (c *controlBox) buildPackage() (bool, error) { version := c.Version.String() log.Info("version is:", version) debname := filename + "_" + version + "_" + arch + ".deb" - fulldebname := filepath.Join(homeDir, "incoming", debname) + var fulldebname string + if argv.OutDir == "" { + fulldebname = debname + } else { + fulldebname = filepath.Join(argv.OutDir, debname) + } if shell.Exists(fulldebname) { log.Info("debian package already built: " + fulldebname) if argv.Auto { diff --git a/control b/control index ad3cb25..0ff619e 100644 --- a/control +++ b/control @@ -4,9 +4,9 @@ Package: go-deb Maintainer: Jeff Carr Packager: Jeff Carr Architecture: amd64 -Depends: +Depends: go-gui-toolkits URL: https://go.wit.com/ -Recommends: go-gui-toolkits +Recommends: Conflicts: testingoldstuff Description: create distribution packages for golang repositories Hopefully, this can make compatible and correct source