add error

This commit is contained in:
Henrique Dias 2016-08-25 21:01:33 +01:00
parent 9fd56bbb92
commit e3fdadc2d4

View File

@ -1,6 +1,7 @@
package hugo package hugo
import ( import (
"errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
@ -147,8 +148,8 @@ func parse(c *caddy.Controller, root string) (*Config, error) {
if hugo, err := exec.LookPath("hugo"); err == nil { if hugo, err := exec.LookPath("hugo"); err == nil {
conf.Hugo = hugo conf.Hugo = hugo
} else { } else {
fmt.Println("It seems that you don't have 'hugo' on your PATH.\nAborting...") fmt.Println("It seems that you don't have 'hugo' on your PATH.")
os.Exit(0) return conf, errors.New("It seems that you don't have 'hugo' on your PATH.")
} }
for c.Next() { for c.Next() {