be stricter about which files to watch
Things like flycheck-elixir in Emacs can create temporary files in the same directory as the upstream files that contain the koans, with a "flycheck_" prefix but still ending in ".ex". This change makes it so that we skip such files.
This commit is contained in:
@@ -23,6 +23,7 @@ defmodule Runner do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@koan_path_pattern ~r/lib\/koans\/(\d+)_\w+.ex$/
|
@koan_path_pattern ~r/lib\/koans\/(\d+)_\w+.ex$/
|
||||||
|
def koan_path_pattern, do: @koan_path_pattern
|
||||||
|
|
||||||
def path_to_number(path) do
|
def path_to_number(path) do
|
||||||
[_path, number] = Regex.run(@koan_path_pattern, path)
|
[_path, number] = Regex.run(@koan_path_pattern, path)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ defmodule Watcher do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp reload(file) do
|
defp reload(file) do
|
||||||
if Path.extname(file) == ".ex" do
|
if String.match?(file, Runner.koan_path_pattern()) do
|
||||||
try do
|
try do
|
||||||
file
|
file
|
||||||
|> portable_load_file
|
|> portable_load_file
|
||||||
|
|||||||
Reference in New Issue
Block a user