Skip to content

Commit

Permalink
Push site build errors to open web pages
Browse files Browse the repository at this point in the history
  • Loading branch information
osteele committed Jul 17, 2017
1 parent 0fc1fc6 commit 1ff6599
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func Unmarshal(bytes []byte, c *Config) error {
var (
compat configCompat
cList collectionsList
// cMap collectionsMap
)
if err := yaml.Unmarshal(bytes, &c); err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions server/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (s *Server) watchAndReload() error {
// Resolves filenames to URLS *before* reloading the site, in case the latter
// changes the url -> filename routes.
urls := map[string]bool{}
for _, relpath := range change.Paths {
url, ok := site.FilenameURLPath(relpath)
for _, rel := range change.Paths {
url, ok := site.FilenameURLPath(rel)
if ok {
urls[url] = true
}
Expand All @@ -46,6 +46,7 @@ func (s *Server) reload(change site.FilesEvent) {
if err != nil {
fmt.Println()
fmt.Fprintln(os.Stderr, err.Error())
s.lr.Alert(fmt.Sprintf("Error reading site configuration: %s", err))
return
}
s.Site = site
Expand Down
2 changes: 1 addition & 1 deletion site/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func FromDirectory(source string, flags config.Flags) (*Site, error) {
default:
err = config.Unmarshal(bytes, &s.config)
if err != nil {
return nil, err
return nil, utils.WrapPathError(err, configPath)
}
s.ConfigFile = &configPath
}
Expand Down

0 comments on commit 1ff6599

Please sign in to comment.