1
0
mirror of https://github.com/go-task/task.git synced 2025-11-06 09:09:13 +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

@@ -4,8 +4,9 @@ import (
"path/filepath"
"sort"
"github.com/go-task/task/internal/osext"
"github.com/mattn/go-zglob"
"github.com/mitchellh/go-homedir"
)
func glob(dir string, globs []string) (files []string, err error) {
@@ -13,7 +14,7 @@ func glob(dir string, globs []string) (files []string, err error) {
if !filepath.IsAbs(g) {
g = filepath.Join(dir, g)
}
g, err = homedir.Expand(g)
g, err = osext.Expand(g)
if err != nil {
return nil, err
}