Skip to content

Commit

Permalink
task: fix script path resolve()
Browse files Browse the repository at this point in the history
closes #35.
  • Loading branch information
yields committed Feb 16, 2020
1 parent d814592 commit 04ff41c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/tj/robo/config"
)

var version = "0.5.4"
var version = "0.5.5"

const usage = `
Usage:
Expand Down
9 changes: 7 additions & 2 deletions task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ func (t *Task) Run(args []string) error {

// RunScript runs the target shell `script` file.
func (t *Task) RunScript(args []string) error {
path := filepath.Join(t.LookupPath, t.Script)
bin := path
var path = t.Script
var bin = path

if !strings.HasPrefix(path, "/") {
path = filepath.Join(t.LookupPath, t.Script)
bin = path
}

stat, err := os.Stat(path)
if err != nil {
Expand Down

0 comments on commit 04ff41c

Please sign in to comment.