pre.hn/lib/pre_dot_hn/static.ex

15 lines
314 B
Elixir

defmodule PreDotHn.Static do
def run() do
"site/static/**/*"
|> Path.wildcard()
|> Enum.each(fn path ->
build_path = String.replace(path, "site", "priv")
if File.dir?(path) do
File.mkdir_p!(build_path)
else
File.copy!(path, build_path)
end
end)
end
end