diff options
author | Cameron Moore <moorereason@gmail.com> | 2016-03-17 13:30:33 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-03-20 23:51:17 +0100 |
commit | 9323707b32a49ac99f56271e041399eaa90dd1cc (patch) | |
tree | 565e68435923cea7f03371343ccead1ed287d930 /commands/new.go | |
parent | bafb77172b8896131db6fad002a32df087b6aec1 (diff) |
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.
Diffstat (limited to 'commands/new.go')
-rw-r--r-- | commands/new.go | 3 |
1 files changed, 1 insertions, 2 deletions
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 { |