Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/tasks/pandoc.ex9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/mix/tasks/pandoc.ex b/lib/mix/tasks/pandoc.ex
index 94d7dd5..179eab8 100644
--- a/lib/mix/tasks/pandoc.ex
+++ b/lib/mix/tasks/pandoc.ex
@@ -24,8 +24,15 @@ defmodule Mix.Tasks.Pandoc do
profile = String.to_atom(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.wildcard()
|> Enum.each(fn path ->