Skip to content

Commit

Permalink
fix panic on yaml parse error. Closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Oct 14, 2015
1 parent 0dc8ba6 commit 04798cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"io/ioutil"
"text/template"

"github.com/tj/robo/task"
"gopkg.in/yaml.v2"

"github.com/tj/robo/task"
)

// Config represents the main YAML configuration
Expand All @@ -30,9 +31,11 @@ func New(file string) (*Config, error) {
}

c, err := NewString(string(b))
c.File = file
if err != nil {
return nil, err
}

return c, err
return c, nil
}

// NewString configuration from string.
Expand Down

0 comments on commit 04798cb

Please sign in to comment.