Cherry.Commands.PortfolioScaffold (cherry v0.4.1)

Copy Markdown View Source

Shared engine for the portfolio gen.* commands: title → slug → a frontmatter scaffold in the collection's directory, refusing to clobber existing entries.

Summary

Functions

The human line every scaffold command prints.

Creates dir/slug.md with the scaffold's frontmatter.

Functions

human(path)

@spec human(String.t()) :: String.t()

The human line every scaffold command prints.

run(context, dir, frontmatter, usage)

@spec run(Cherry.CLI.Context.t(), String.t(), (String.t() -> String.t()), String.t()) ::
  {:ok, map()} | {:error, Cherry.CLI.Error.t()}

Creates dir/slug.md with the scaffold's frontmatter.