mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
commands: Do not fail server build when /static is missing
This was a un-intended change in Hugo 0.42. Most sites will have a static directory so this should not be a big issue, but this commit will revert back to old behaviour. Fixes #4846
This commit is contained in:
parent
0f1fc01ef2
commit
34ee27a78b
2 changed files with 4 additions and 6 deletions
|
@ -235,11 +235,6 @@ Single: {{ .Title }}
|
||||||
|
|
||||||
List: {{ .Title }}
|
List: {{ .Title }}
|
||||||
|
|
||||||
`)
|
|
||||||
|
|
||||||
writeFile(t, filepath.Join(d, "static", "my.txt"), `
|
|
||||||
MyMy
|
|
||||||
|
|
||||||
`)
|
`)
|
||||||
|
|
||||||
return d, nil
|
return d, nil
|
||||||
|
|
|
@ -277,8 +277,11 @@ func (c *commandeer) fullBuild() error {
|
||||||
copyStaticFunc := func() error {
|
copyStaticFunc := func() error {
|
||||||
cnt, err := c.copyStatic()
|
cnt, err := c.copyStatic()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !os.IsNotExist(err) {
|
||||||
return fmt.Errorf("Error copying static files: %s", err)
|
return fmt.Errorf("Error copying static files: %s", err)
|
||||||
}
|
}
|
||||||
|
c.Logger.WARN.Println("No Static directory found")
|
||||||
|
}
|
||||||
langCount = cnt
|
langCount = cnt
|
||||||
langCount = cnt
|
langCount = cnt
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue