only run elixir code
ignore, for example, editor swapfiles
This commit is contained in:
@@ -13,16 +13,18 @@ defmodule Watcher do
|
||||
end
|
||||
|
||||
defp reload(file) do
|
||||
try do
|
||||
file
|
||||
|> normalize
|
||||
|> Code.load_file
|
||||
|> Enum.map(&(elem(&1, 0)))
|
||||
|> Enum.find(&Runner.koan?/1)
|
||||
|> Runner.modules_to_run
|
||||
|> Runner.run
|
||||
rescue
|
||||
e -> Display.show_compile_error(e)
|
||||
if Path.extname(file) == ".ex" do
|
||||
try do
|
||||
file
|
||||
|> normalize
|
||||
|> Code.load_file
|
||||
|> Enum.map(&(elem(&1, 0)))
|
||||
|> Enum.find(&Runner.koan?/1)
|
||||
|> Runner.modules_to_run
|
||||
|> Runner.run
|
||||
rescue
|
||||
e -> Display.show_compile_error(e)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user