From e5a5454bc0e58d24a6146e4973518160b909582f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 14 Feb 2025 18:39:59 -0600 Subject: [PATCH] minor improvments --- repo.common.go | 10 ++++++++++ rill.go | 2 +- shell.go | 15 +++++---------- 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 repo.common.go diff --git a/repo.common.go b/repo.common.go new file mode 100644 index 0000000..6a30f46 --- /dev/null +++ b/repo.common.go @@ -0,0 +1,10 @@ +package gitpb + +// does this repo build a binary? +func (r *Repo) IsBinary() bool { + if r.GoInfo != nil { + return r.GoInfo.GetGoBinary() + } + // todo: detect C & other language binary packages + return false +} diff --git a/rill.go b/rill.go index d072733..5106a44 100644 --- a/rill.go +++ b/rill.go @@ -29,7 +29,7 @@ func (repo *Repo) GitPull() (*cmd.Status, error) { */ var cmd []string cmd = append(cmd, "git", "pull") - return repo.RunVerbose(cmd) + return nil, repo.RunVerbose(cmd) } // rill is awesome. long live rill diff --git a/shell.go b/shell.go index 6a7b996..aff56ef 100644 --- a/shell.go +++ b/shell.go @@ -136,19 +136,14 @@ func (repo *Repo) RunStrictAll(all [][]string) (*cmd.Status, error) { return nil, nil } -func (repo *Repo) RunVerbose(cmd []string) (*cmd.Status, error) { - log.Info("Running:", repo.GetGoPath(), cmd) - r, err := repo.RunStrict(cmd) +func (repo *Repo) RunVerbose(cmd []string) error { + log.Info("EXEC Running:", repo.GetGoPath(), cmd) + err := shell.PathExecVerbose(repo.GetFullPath(), cmd) if err != nil { log.Info("Error", cmd, err) + return err } - for _, line := range r.Stdout { - log.Info(line) - } - for _, line := range r.Stderr { - log.Info(line) - } - return r, err + return nil } func (repo *Repo) RunVerboseOnError(cmd []string) (*cmd.Status, error) {