From 9323707b32a49ac99f56271e041399eaa90dd1cc Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Thu, 17 Mar 2016 13:30:33 -0500 Subject: create: Refactor NewContent to be testable NewContent is refactored to use the afero.Fs interface that should allow full testing. This commit also pulls the metadata creation logic out of NewContent and into a separate function to decrease the cyclomatic complexity of NewContent. --- commands/new.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'commands') diff --git a/commands/new.go b/commands/new.go index 170952a05..4fc000319 100644 --- a/commands/new.go +++ b/commands/new.go @@ -110,8 +110,7 @@ func NewContent(cmd *cobra.Command, args []string) error { kind = contentType } - return create.NewContent(kind, createpath) - + return create.NewContent(hugofs.SourceFs, kind, createpath) } func doNewSite(basepath string, force bool) error { -- cgit v1.2.3