actually implement --dir
This commit is contained in:
parent
4f27202bce
commit
2141737e7c
|
@ -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
|
||||
|
|
2
argv.go
2
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"`
|
||||
|
|
|
@ -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 {
|
||||
|
|
4
control
4
control
|
@ -4,9 +4,9 @@ Package: go-deb
|
|||
Maintainer: Jeff Carr <jcarr@wit.com>
|
||||
Packager: Jeff Carr <jcarr@wit.com>
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue