Take watch dirs as an argument

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-17 11:17:37 -07:00
parent 9cb7bf35ab
commit 58747a4bc6

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
)