summaryrefslogtreecommitdiff
path: root/fs.go
diff options
context:
space:
mode:
Diffstat (limited to 'fs.go')
-rw-r--r--fs.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs.go b/fs.go
index bd27cf8..86de16b 100644
--- a/fs.go
+++ b/fs.go
@@ -208,11 +208,15 @@ func collectFromDir(
// Process defaults for this directory if a defaults.toml is found
defaultsPath := path.Join(dir, DEFAULTS)
if info, err := os.Stat(defaultsPath); err == nil && !info.IsDir() {
- d := DecodeDefaults(defaultsPath, cfgs)
+ d, err := DecodeDefaults(defaultsPath, cfgs)
+
+ if err != nil {
+ log.Fatalf("Error encounter in %s: %v\n", defaultsPath, err);
+ }
// inherit the properties not defined in this defaults
if defaults != nil {
- d.Inherit(defaults)
+ d.Inherit(*defaults)
}
defaults = &d
@@ -240,7 +244,12 @@ func collectFromDir(
}
// Decode a unit
- config := DecodeConfig(child, cfgs)
+ config, err := DecodeConfig(child, cfgs)
+
+ if err != nil {
+ log.Fatalf("Error encountered in %s: %v", child, config)
+ }
+
config.Inherit(*defaults)
tc := TestCase {