markbates / refresh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

set "app_root" from environment variables

BastiPaeltz opened this issue · comments

Hey,

I think it would be nice to be able to set the app_root from environment variables like this:

app_root: "$GOPATH/src/$APP_PATH"

It should be pretty easy to implement this, there just would need to be a call to os.ExpandEnv(c.AppRoot) at the end of the Load function. E.g.:

func (c *Configuration) Load(path string) error {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return err
	}
	err = yaml.Unmarshal(data, c)
	if err != nil {
		return err
	}

	c.AppRoot = os.ExpandEnv(c.AppRoot)

	return err
}