Extracted watcher and runner into supervision tree.
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
defmodule Watcher do
|
||||
use ExFSWatch, dirs: ["lib/koans"]
|
||||
|
||||
def start_link do
|
||||
start()
|
||||
end
|
||||
|
||||
def callback(file, events) do
|
||||
if Enum.member?(events, :modified) do
|
||||
file |> normalize |> reload
|
||||
|
||||
if Tracker.complete? do
|
||||
Display.congratulate
|
||||
exit(:normal)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user