mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 22:50:35 +03:00
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.
This commit is contained in:
parent
bafb77172b
commit
9323707b32
3 changed files with 197 additions and 55 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue