--keep-files argv flag
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
a8b538c14b
commit
ea894bdfe0
1
argv.go
1
argv.go
|
@ -20,6 +20,7 @@ type args struct {
|
||||||
Repo string `arg:"--repo" help:"go get path to the repo"`
|
Repo string `arg:"--repo" help:"go get path to the repo"`
|
||||||
PkgDir string `arg:"--pkg-dir" help:"set default directory (~/incoming/)"`
|
PkgDir string `arg:"--pkg-dir" help:"set default directory (~/incoming/)"`
|
||||||
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/"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -174,11 +174,15 @@ func (c *controlBox) buildPackage() (bool, error) {
|
||||||
|
|
||||||
// cleanup files
|
// cleanup files
|
||||||
if shell.Exists("files") {
|
if shell.Exists("files") {
|
||||||
|
if argv.KeepFiles {
|
||||||
|
log.Info("keeping the build files/")
|
||||||
|
} else {
|
||||||
if shell.Run([]string{"rm", "-rf", "files"}) {
|
if shell.Run([]string{"rm", "-rf", "files"}) {
|
||||||
log.Warn("rm failed")
|
log.Warn("rm failed")
|
||||||
return false, errors.New("rm files/")
|
return false, errors.New("rm files/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue