~ihabunek/triglav

ref: 7bdb88d4d88886e08c456f7ee012d7a343a73731 triglav/lib/triglav.ex -rw-r--r-- 474 bytes
7bdb88d4Ivan Habunek Split validation from persisting errors 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
defmodule Triglav do
  @moduledoc """
  Triglav keeps the contexts that define your domain
  and business logic.

  Contexts are also responsible for managing your data, regardless
  if it comes from the database, an external API or others.
  """

  def tmp_dir() do
    with dir when is_binary(dir) <- System.tmp_dir(),
         path = Path.join([dir, "triglav_tmp"]),
         :ok <- File.mkdir_p(path) do
      {:ok, path}
    else
      _ -> :error
    end
  end
end

3