Add Pleroma.Utils.compile_dir/1
This commit is contained in:
parent
a75d4a41e0
commit
84f891ea3e
@ -73,9 +73,7 @@ defmodule Pleroma.Application do
|
|||||||
|
|
||||||
if dir && File.exists?(dir) do
|
if dir && File.exists?(dir) do
|
||||||
dir
|
dir
|
||||||
|> File.ls!()
|
|> Pleroma.Utils.compile_dir()
|
||||||
|> Enum.map(&Path.join(dir, &1))
|
|
||||||
|> Kernel.ParallelCompiler.compile()
|
|
||||||
|> case do
|
|> case do
|
||||||
{:error, _errors, _warnings} ->
|
{:error, _errors, _warnings} ->
|
||||||
raise "Invalid custom modules"
|
raise "Invalid custom modules"
|
||||||
|
12
lib/pleroma/utils.ex
Normal file
12
lib/pleroma/utils.ex
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Utils do
|
||||||
|
def compile_dir(dir) when is_binary(dir) do
|
||||||
|
dir
|
||||||
|
|> File.ls!()
|
||||||
|
|> Enum.map(&Path.join(dir, &1))
|
||||||
|
|> Kernel.ParallelCompiler.compile()
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user