2018-02-17 20:12:41 +02:00
|
|
|
package compiler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"strings"
|
|
|
|
|
2020-08-19 10:59:58 +02:00
|
|
|
"github.com/go-task/task/v3/taskfile"
|
2018-02-17 20:12:41 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// GetEnviron the all return all environment variables encapsulated on a
|
|
|
|
// taskfile.Vars
|
2020-03-29 21:54:59 +02:00
|
|
|
func GetEnviron() *taskfile.Vars {
|
|
|
|
m := &taskfile.Vars{}
|
|
|
|
for _, e := range os.Environ() {
|
2018-02-17 20:12:41 +02:00
|
|
|
keyVal := strings.SplitN(e, "=", 2)
|
|
|
|
key, val := keyVal[0], keyVal[1]
|
2023-11-28 20:18:28 +02:00
|
|
|
m.Set(key, taskfile.Var{Value: val})
|
2018-02-17 20:12:41 +02:00
|
|
|
}
|
|
|
|
return m
|
|
|
|
}
|