more README stuff, example README, other misc cleanup

This commit is contained in:
Ben Kraft
2020-01-16 17:56:13 -08:00
parent 2c3702e282
commit 35699a73ef
7 changed files with 52 additions and 3 deletions
+8 -1
View File
@@ -62,7 +62,7 @@ func ReadAndValidateConfig(filename string) (*Config, error) {
}
var config Config
err = yaml.Unmarshal(text, config)
err = yaml.Unmarshal(text, &config)
if err != nil {
return nil, fmt.Errorf("invalid config file %v: %v", filename, err)
}
@@ -72,5 +72,12 @@ func ReadAndValidateConfig(filename string) (*Config, error) {
return nil, fmt.Errorf("invalid config file %v: %v", filename, err)
}
// Make paths relative to config dir
// TODO: more principled typing here?
basename := filepath.Dir(filename)
config.Schema = filepath.Join(basename, config.Schema)
config.Queries = filepath.Join(basename, config.Queries)
config.Generated = filepath.Join(basename, config.Generated)
return &config, nil
}