mirror of
https://github.com/go-task/task.git
synced 2025-08-08 22:36:57 +02:00
fix: forward env to RunCommand when evaluating sh vars (#1869)
* forward env to RunCommand when evaluating sh vars. fixes #1742 * feat: added tests * fix: test --------- Co-authored-by: Pete Davison <pd93.uk@outlook.com>
This commit is contained in:
8
internal/env/env.go
vendored
8
internal/env/env.go
vendored
@ -12,8 +12,14 @@ func Get(t *ast.Task) []string {
|
||||
if t.Env == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return GetFromVars(t.Env)
|
||||
}
|
||||
|
||||
func GetFromVars(env *ast.Vars) []string {
|
||||
environ := os.Environ()
|
||||
for k, v := range t.Env.ToCacheMap() {
|
||||
|
||||
for k, v := range env.ToCacheMap() {
|
||||
if !isTypeAllowed(v) {
|
||||
continue
|
||||
}
|
||||
|
Reference in New Issue
Block a user