Removed the Windows part. It wasn't working properly.

For issue #304.
This commit is contained in:
Michael Banzon 2015-11-05 18:12:06 +01:00
parent 01465932e7
commit 8774c90709

View File

@ -9,8 +9,7 @@ import (
)
var (
unixEnvRegEx = regexp.MustCompile("{\\$[^}]+}")
windowsEnvRegEx = regexp.MustCompile("{%[^}]+%}")
envRegEx = regexp.MustCompile("{\\$[^}]+}")
)
type parser struct {
@ -338,18 +337,11 @@ func (sb serverBlock) HostList() []string {
}
func getValFromEnv(s string) string {
envRefsUnix := unixEnvRegEx.FindAllString(s, -1)
envRefs := envRegEx.FindAllString(s, -1)
for _, ref := range envRefsUnix {
for _, ref := range envRefs {
s = strings.Replace(s, ref, os.Getenv(ref[2:len(ref)-1]), -1)
}
envRefsWin := unixEnvRegEx.FindAllString(s, -1)
for _, ref := range envRefsWin {
s = strings.Replace(s, ref, os.Getenv(ref[2:len(ref)-2]), -1)
}
return s
}