diff options
| author | Jeff Carr <[email protected]> | 2024-02-12 18:16:03 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-12 18:16:03 -0600 |
| commit | e7a3ef1298cb50fc69ca2fb61d81b4a74838a2c4 (patch) | |
| tree | 9a0e1070bb2050cd194d022d12dd8d519c48587e /common.go | |
| parent | b4a571fb70905d69161b204784fff77517ee5022 (diff) | |
try to probe the git go package type
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'common.go')
| -rw-r--r-- | common.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1,6 +1,8 @@ package repostatus import ( + "strings" + "go.wit.com/log" // "go.wit.com/gui/gui" ) @@ -69,3 +71,14 @@ func (rs *RepoStatus) Initialized() bool { return true } */ + +func (rs *RepoStatus) RepoType() string { + err, output := rs.RunCmd([]string{"go", "list", "-f", "'{{if eq .Name \"main\"}}binary{{else}}library{{end}}'"}) + if err == nil { + output = strings.Trim(output, "'") + log.Info("go package is:", output) + return output + } + log.Info("package is: unknown", err) + return "" +} |
