Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-12-11 18:11:43 -0800
committerCatalin Mititiuc <webdevcat@proton.me>2024-12-11 18:11:43 -0800
commit7ad009e1adb16ed88ce6618515d35118a1708a79 (patch)
tree3efb4c6036b1ca1deefbb5345b29c95f2c412e99 /lib/pandoc.ex
parent192d65a059c7f359bb7e3bc8927fc2efd24de92e (diff)
Git watcher dirs from config
Diffstat (limited to 'lib/pandoc.ex')
-rw-r--r--lib/pandoc.ex6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pandoc.ex b/lib/pandoc.ex
index 882d772..9002bb5 100644
--- a/lib/pandoc.ex
+++ b/lib/pandoc.ex
@@ -3,7 +3,11 @@ defmodule Pandoc do
Documentation for `Pandoc`.
"""
- def run(profile, ["--watch" | dirs]) do
+ def run(profile, ["--watch" | _]) do
+ config = Application.get_env(:pandoc, profile)
+ opts = [cd: config[:cd] || File.cwd!()]
+ dirs = [opts[:cd], Path.join(opts[:cd], "_drafts")]
+
ref =
__MODULE__.Supervisor
|> Supervisor.start_child(