1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Expand environment variables on "dir", "sources" and "generates"

So a path like this works: $GOPATH/src/github.com/go-task/task

Allowing of "~" was also implemented. See #74 and baac067a1a

Fixes #116
This commit is contained in:
Andrey Nering
2018-06-16 14:25:15 -03:00
parent a830dba5da
commit 102f8ab74e
4 changed files with 28 additions and 5 deletions

View File

@@ -3,10 +3,9 @@ package task
import (
"path/filepath"
"github.com/go-task/task/internal/osext"
"github.com/go-task/task/internal/taskfile"
"github.com/go-task/task/internal/templater"
"github.com/mitchellh/go-homedir"
)
var (
@@ -41,7 +40,7 @@ func (e *Executor) CompiledTask(call taskfile.Call) (*taskfile.Task, error) {
Method: r.Replace(origTask.Method),
Prefix: r.Replace(origTask.Prefix),
}
new.Dir, err = homedir.Expand(new.Dir)
new.Dir, err = osext.Expand(new.Dir)
if err != nil {
return nil, err
}