X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Futils.ex;h=bd9939c9fa9fe9b8f0625052c728ea69a5829dcf;hb=9a320ba8149a3efae1235b3b68dbf1bbad423e0d;hp=a446d3ae6f32a80d73a3780fe69e073f52aaccce;hpb=62bf6d67e393d2b290d226e8505d622d944c9a26;p=akkoma diff --git a/lib/pleroma/utils.ex b/lib/pleroma/utils.ex index a446d3ae6..bd9939c9f 100644 --- a/lib/pleroma/utils.ex +++ b/lib/pleroma/utils.ex @@ -14,10 +14,23 @@ defmodule Pleroma.Utils do @repo_timeout Pleroma.Config.get([Pleroma.Repo, :timeout], 15_000) def compile_dir(dir) when is_binary(dir) do + dir + |> elixir_files() + |> Kernel.ParallelCompiler.compile() + end + + defp elixir_files(dir) when is_binary(dir) do dir |> File.ls!() |> Enum.map(&Path.join(dir, &1)) - |> Kernel.ParallelCompiler.compile() + |> Enum.flat_map(fn path -> + if File.dir?(path) do + elixir_files(path) + else + [path] + end + end) + |> Enum.filter(fn path -> String.ends_with?(path, ".ex") end) end @doc """