diff options
Diffstat (limited to 'doDebian.go')
| -rw-r--r-- | doDebian.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/doDebian.go b/doDebian.go index 34861f0..52753ca 100644 --- a/doDebian.go +++ b/doDebian.go @@ -149,13 +149,24 @@ func shouldBuild(repo *gitpb.Repo) bool { return false } +// avoids nil panics +func isDebianRelease() bool { + if argv.Build == nil { + return false + } + if argv.Build.Debian == nil { + return false + } + return argv.Build.Debian.Release +} + func buildDeb(check *gitpb.Repo) error { var cmd []string outdir := getOutdir(check) os.MkdirAll(outdir, 0755) - if argv.Build.Debian.Release { + if isDebianRelease() { cmd = []string{"go-deb", "--release", "--namespace", check.Namespace, "--dir", outdir} } else { cmd = []string{"go-deb", "--namespace", check.Namespace, "--dir", outdir} |
