Merge pull request #263 from listx/stricter-watching

be stricter about which files to watch
This commit is contained in:
Jay Hayes
2021-07-20 20:38:07 -05:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ defmodule Runner do
end
@koan_path_pattern ~r/lib\/koans\/(\d+)_\w+.ex$/
def koan_path_pattern, do: @koan_path_pattern
def path_to_number(path) do
[_path, number] = Regex.run(@koan_path_pattern, path)

View File

@@ -21,7 +21,7 @@ defmodule Watcher do
end
defp reload(file) do
if Path.extname(file) == ".ex" do
if String.match?(file, Runner.koan_path_pattern()) do
try do
file
|> portable_load_file