diff options
Diffstat (limited to 'common.go')
| -rw-r--r-- | common.go | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -39,7 +39,6 @@ func (rs *RepoStatus) GetPath() string { } */ - /* func (rs *RepoStatus) Draw() { if !rs.Ready() { @@ -88,6 +87,16 @@ func (rs *RepoStatus) Ready() bool { return rs.ready } +func (rs *RepoStatus) IsGoLang() bool { + if !rs.Ready() { + return false + } + if rs.isGoLang.String() == "true" { + return true + } + return false +} + /* func (rs *RepoStatus) Initialized() bool { log.Log(CHANGE, "checking Initialized()") @@ -98,6 +107,9 @@ func (rs *RepoStatus) Initialized() bool { */ func (rs *RepoStatus) RepoType() string { + if !rs.IsGoLang() { + return "" + } err, output := rs.RunCmd([]string{"go", "list", "-f", "'{{if eq .Name \"main\"}}binary{{else}}library{{end}}'"}) if err == nil { output = strings.Trim(output, "'") @@ -117,6 +129,9 @@ func (rs *RepoStatus) BinaryName() string { } func (rs *RepoStatus) Build() bool { + if !rs.IsGoLang() { + return false + } name := rs.BinaryName() // removes the binary if it already exists rs.RunCmd([]string{"rm", "-f", name}) |
