Take watch dirs as an argument

This commit is contained in:
Catalin Constantin Mititiuc 2024-12-05 14:51:31 -08:00
parent 6fc8e8ec19
commit c9cc0ed856

View File

@ -3,7 +3,7 @@ defmodule Pandoc do
Documentation for `Pandoc`.
"""
def run(profile, ["--watch"]) do
def run(profile, ["--watch" | dirs]) do
IO.puts("""
Pandoc watcher starting, env: #{Application.get_env(:pandoc, profile) |> inspect(pretty: true)}
@ -12,7 +12,7 @@ defmodule Pandoc do
ref =
__MODULE__.Supervisor
|> Supervisor.start_child(
Supervisor.child_spec({Pandoc.Watcher, [profile, dirs: ["documents"]]},
Supervisor.child_spec({Pandoc.Watcher, [profile, dirs: dirs]},
restart: :transient,
id: __MODULE__.Watcher
)