i thought i had a pre-commit hook for this
master
Jordan Orelli 10 years ago
parent 536c94a586
commit a100556004

@ -37,20 +37,19 @@ func Parse(dest interface{}) {
bail(1, "unable to parse cli args: %s", err) bail(1, "unable to parse cli args: %s", err)
} }
var doc *Doc var doc *Doc
f, err := os.Open(DefaultPath) f, err := os.Open(DefaultPath)
if err == nil { if err == nil {
defer f.Close() defer f.Close()
d, err := Read(f) d, err := Read(f)
if err != nil { if err != nil {
bail(1, "unable to parse moon config file at path %s: %s", DefaultPath, err) bail(1, "unable to parse moon config file at path %s: %s", DefaultPath, err)
} }
doc = d doc = d
} else { } else {
doc = &Doc{items: make(map[string]interface{})} doc = &Doc{items: make(map[string]interface{})}
} }
for k, v := range cliArgs { for k, v := range cliArgs {
doc.items[k] = v doc.items[k] = v

Loading…
Cancel
Save