From ad7f48d8ed5fac3b56d03768d1ed2a4bca95e305 Mon Sep 17 00:00:00 2001 From: Patrick Koperwas Date: Sun, 28 Jan 2018 15:59:00 -0800 Subject: [PATCH] fix: Fix using relative path to dir for binpath --- tychus/orchestrator.go | 16 ++++++++++++---- tychus/runner.go | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tychus/orchestrator.go b/tychus/orchestrator.go index 34d3245..518051e 100644 --- a/tychus/orchestrator.go +++ b/tychus/orchestrator.go @@ -100,10 +100,18 @@ func Start(args []string, c *Configuration) error { // sure to expand any quotes strings. func formatArgs(args []string, c *Configuration) ([]string, error) { if c.Build.Enabled { - args = append([]string{filepath.Join( - c.Build.TargetPath, - c.Build.BinName, - )}, args...) + binPath, err := filepath.Abs( + filepath.Join( + c.Build.TargetPath, + c.Build.BinName, + ), + ) + + if err != nil { + return nil, err + } + + args = append([]string{binPath}, args...) } // Can occur when running with build disabled. Since no binary to run, need diff --git a/tychus/runner.go b/tychus/runner.go index a70a7f6..d6ac9dd 100644 --- a/tychus/runner.go +++ b/tychus/runner.go @@ -6,6 +6,7 @@ import ( "io" "os" "os/exec" + "strings" "time" ) @@ -33,6 +34,7 @@ func (r *runner) start(c *Configuration) { } go func() { + c.Logger.Debugf("Running: %v", strings.Join(r.args, " ")) if err := r.rerun(); err != nil { r.events <- event{op: errored, info: err.Error()} }