diff options
author | Ben Burwell <ben@benburwell.com> | 2019-08-13 15:49:47 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-08-13 15:49:47 -0400 |
commit | f66905f36427aa7b066186d722a8af8d3e2c0275 (patch) | |
tree | 40cab23108da4a98291aa0d768fb729561ef15d8 /template.go | |
parent | e4839bdff00f09ccb4e0a8b12d634d26d172dfc9 (diff) |
remove hardcoded paths
Diffstat (limited to 'template.go')
-rw-r--r-- | template.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/template.go b/template.go index 7e933bb..a98abb1 100644 --- a/template.go +++ b/template.go @@ -40,8 +40,8 @@ func lookupPassword(name string) (string, error) { return strings.TrimRight(string(line), "\n"), nil } -func getTemplateData() (*TemplateData, error) { - vars, err := readVars() +func getTemplateData(conf *Conf) (*TemplateData, error) { + vars, err := readVars(conf) if err != nil { return nil, err } @@ -63,9 +63,9 @@ func getTemplateData() (*TemplateData, error) { return data, nil } -func readVars() (map[string]interface{}, error) { +func readVars(conf *Conf) (map[string]interface{}, error) { var vars map[string]interface{} - if _, err := toml.DecodeFile(filepath.Join(base, "vars.toml"), &vars); err != nil { + if _, err := toml.DecodeFile(filepath.Join(conf.Source, "vars.toml"), &vars); err != nil { return nil, err } return vars, nil |