Clear converted markdown directory before running mix task
This commit is contained in:
parent
ef76548337
commit
a248af3d3c
@ -24,8 +24,15 @@ defmodule Mix.Tasks.Pandoc do
|
|||||||
|
|
||||||
profile = String.to_atom(profile)
|
profile = String.to_atom(profile)
|
||||||
config = Application.get_env(:pandoc, profile)
|
config = Application.get_env(:pandoc, profile)
|
||||||
|
args = config[:args] || []
|
||||||
|
opts = [cd: config[:cd] || File.cwd!()]
|
||||||
|
|
||||||
(config[:cd] || File.cwd!())
|
out_path = List.last(args)
|
||||||
|
full_out_path = [opts[:cd], out_path] |> Path.join() |> Path.expand()
|
||||||
|
File.rm_rf!(full_out_path)
|
||||||
|
File.mkdir_p!(full_out_path)
|
||||||
|
|
||||||
|
opts[:cd]
|
||||||
|> Path.join("*#{@ext}")
|
|> Path.join("*#{@ext}")
|
||||||
|> Path.wildcard()
|
|> Path.wildcard()
|
||||||
|> Enum.each(fn path ->
|
|> Enum.each(fn path ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user