hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 34ee27a78b9e2b5f475d44253ae234067b76cc6e
parent 0f1fc01ef2db0421c2ee541c58b3744d1bf25d76
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Wed, 13 Jun 2018 08:48:20 +0200

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

Diffstat:
Mcommands/commands_test.go | 5-----
Mcommands/hugo.go | 5++++-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/commands/commands_test.go b/commands/commands_test.go
@@ -237,11 +237,6 @@ List: {{ .Title }}
 
 `)
 
-	writeFile(t, filepath.Join(d, "static", "my.txt"), `
-MyMy
-
-`)
-
 	return d, nil
 
 }
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -277,7 +277,10 @@ func (c *commandeer) fullBuild() error {
 	copyStaticFunc := func() error {
 		cnt, err := c.copyStatic()
 		if err != nil {
-			return fmt.Errorf("Error copying static files: %s", err)
+			if !os.IsNotExist(err) {
+				return fmt.Errorf("Error copying static files: %s", err)
+			}
+			c.Logger.WARN.Println("No Static directory found")
 		}
 		langCount = cnt
 		langCount = cnt