Skip to content

Commit

Permalink
fix: Fix using relative path to dir for binpath
Browse files Browse the repository at this point in the history
  • Loading branch information
PatKoperwas committed Jan 28, 2018
1 parent 493958d commit ad7f48d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tychus/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tychus/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"os"
"os/exec"
"strings"
"time"
)

Expand Down Expand Up @@ -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()}
}
Expand Down

0 comments on commit ad7f48d

Please sign in to comment.