forked from toolshed/abra
proper env modifiers support
This implements proper modifier support in the env file using this new fork of the godotenv library. The modifier implementation is quite basic for but can be improved later if needed. See this commit for the actual implementation. Because we are now using proper modifer parsing, it does not affect the parsing of value, so this is possible again: ``` MY_VAR="#foo" ``` Closes coop-cloud/organising#535
This commit is contained in:
@ -227,7 +227,7 @@ func Get(recipeName string, offline bool) (Recipe, error) {
|
||||
}
|
||||
|
||||
envSamplePath := path.Join(config.RECIPES_DIR, recipeName, ".env.sample")
|
||||
sampleEnv, err := config.ReadEnv(envSamplePath, config.ReadEnvOptions{})
|
||||
sampleEnv, err := config.ReadEnv(envSamplePath)
|
||||
if err != nil {
|
||||
return Recipe{}, err
|
||||
}
|
||||
@ -255,9 +255,9 @@ func Get(recipeName string, offline bool) (Recipe, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r Recipe) SampleEnv(opts config.ReadEnvOptions) (map[string]string, error) {
|
||||
func (r Recipe) SampleEnv() (map[string]string, error) {
|
||||
envSamplePath := path.Join(config.RECIPES_DIR, r.Name, ".env.sample")
|
||||
sampleEnv, err := config.ReadEnv(envSamplePath, opts)
|
||||
sampleEnv, err := config.ReadEnv(envSamplePath)
|
||||
if err != nil {
|
||||
return sampleEnv, fmt.Errorf("unable to discover .env.sample for %s", r.Name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user