diff options
| author | Jeff Carr <[email protected]> | 2024-02-12 21:50:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-12 21:50:54 -0600 |
| commit | d7a0246af9e3b9a970f4bef2e4e5bdcb124f793a (patch) | |
| tree | 635bd45829efeb5540cf3d0178d90611f6d1ccb4 /common.go | |
| parent | e7a3ef1298cb50fc69ca2fb61d81b4a74838a2c4 (diff) | |
add more xterm options
Diffstat (limited to 'common.go')
| -rw-r--r-- | common.go | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -82,3 +82,29 @@ func (rs *RepoStatus) RepoType() string { log.Info("package is: unknown", err) return "" } + +func (rs *RepoStatus) BinaryName() string { + // get the package name from the repo name + path := rs.String() + parts := strings.Split(path, "/") + name := parts[len(parts)-1] + return name +} + +func (rs *RepoStatus) Build() bool { + name := rs.BinaryName() + // removes the binary if it already exists + rs.RunCmd([]string{"rm", "-f", name}) + if rs.Exists(name) { + log.Warn("file could not be removed filename =", name) + return false + } + log.Info("need to build here", rs.String()) + rs.RunCmd([]string{"go", "build", "-v", "-x"}) + if rs.Exists(name) { + log.Warn("build worked", name) + return true + } + log.Warn("build failed", name) + return false +} |
