         Enum.each mkdir_result, fn {dirname, _} ->
           IO.puts "Created directory `#{dirname}`."
         end
-        :ok
       [{dirname, {:error, reason}}|_] ->
         {:error, {reason, dirname, 0}}
     end

        date_format: "{WDfull}, {D} {Mshort} {YYYY}",
        preview_length: 200}
      |> Poison.encode!(pretty: true, indent: 2)
    fwrite "#{dir}serum.json", projinfo
    IO.puts "Generated `#{dir}serum.json`."
  end

  # Generates a minimal index page for the new project.
  @spec create_index(binary) :: :ok

  defp create_index(dir) do
    fwrite "#{dir}pages/index.md", """
    ---
    title: Welcome
    ---

    *Hello, world!*
    """
    IO.puts "Generated `#{dir}pages/pages.json`."
  end

  # Generates default template files.

  @spec init(binary, boolean) :: Error.result

  def init(dir, force?) do
    with :ok <- check_dir(dir, force?),
         :ok <- create_dir(dir)
    do
