Use MkdirAll instead of Mkdir in `hugo gen doc`
authorAnthony Fok <foka@debian.org>
Sat, 28 Nov 2015 14:42:40 +0000 (07:42 -0700)
committerAnthony Fok <foka@debian.org>
Sat, 19 Dec 2015 13:08:01 +0000 (06:08 -0700)
Also print a feedback if the path does not exist and needs to be created.

commands/gendoc.go

index 563208312544c35668fe1bc356a619d8385116cb..eaea51a935b875454f602f05c702227a56663da0 100644 (file)
@@ -50,7 +50,8 @@ for rendering in Hugo.`,
                        gendocdir += helpers.FilePathSeparator
                }
                if found, _ := helpers.Exists(gendocdir, hugofs.OsFs); !found {
-                       hugofs.OsFs.Mkdir(gendocdir, 0777)
+                       jww.FEEDBACK.Println("Directory", gendocdir, "does not exist, creating...")
+                       hugofs.OsFs.MkdirAll(gendocdir, 0777)
                }
                now := time.Now().Format(time.RFC3339)
                prepender := func(filename string) string {