pre.hn/lib/lain/static.ex

18 lines
356 B
Elixir
Raw Permalink Normal View History

2025-01-10 22:30:05 +00:00
defmodule Lain.Static do
def run(path) do
path
|> Path.expand()
2025-01-10 22:30:05 +00:00
|> 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