pre.hn/lib/lain/static.ex

17 lines
356 B
Elixir

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