forked from AkkomaGang/akkoma
little refactor
This commit is contained in:
parent
5ff12e7df1
commit
be32d90a0c
1 changed files with 7 additions and 5 deletions
|
@ -4,12 +4,14 @@ defmodule Pleroma.Docs.JSON do
|
|||
@spec process(keyword()) :: {:ok, String.t()}
|
||||
def process(descriptions) do
|
||||
config_path = "docs/generate_config.json"
|
||||
{:ok, file} = File.open(config_path, [:write])
|
||||
json = generate_json(descriptions)
|
||||
IO.write(file, json)
|
||||
:ok = File.close(file)
|
||||
|
||||
with {:ok, file} <- File.open(config_path, [:write]),
|
||||
json <- generate_json(descriptions),
|
||||
:ok <- IO.write(file, json),
|
||||
:ok <- File.close(file) do
|
||||
{:ok, config_path}
|
||||
end
|
||||
end
|
||||
|
||||
@spec generate_json([keyword()]) :: String.t()
|
||||
def generate_json(descriptions) do
|
||||
|
|
Loading…
Reference in a new issue