Normalize the file before calling reload.
Fixing: https://github.com/elixirkoans/elixir-koans/issues/138 By normalizing first we remove the IntelliJ specific suffix if it is present which allows the ".ex" extension to correctly match IntelliJ edited files.
This commit is contained in:
@@ -3,7 +3,7 @@ defmodule Watcher do
|
|||||||
|
|
||||||
def callback(file, events) do
|
def callback(file, events) do
|
||||||
if Enum.member?(events, :modified) do
|
if Enum.member?(events, :modified) do
|
||||||
reload(file)
|
file |> normalize |> reload
|
||||||
|
|
||||||
if Tracker.complete? do
|
if Tracker.complete? do
|
||||||
Display.congratulate
|
Display.congratulate
|
||||||
@@ -16,7 +16,6 @@ defmodule Watcher do
|
|||||||
if Path.extname(file) == ".ex" do
|
if Path.extname(file) == ".ex" do
|
||||||
try do
|
try do
|
||||||
file
|
file
|
||||||
|> normalize
|
|
||||||
|> Code.load_file
|
|> Code.load_file
|
||||||
|> Enum.map(&(elem(&1, 0)))
|
|> Enum.map(&(elem(&1, 0)))
|
||||||
|> Enum.find(&Runner.koan?/1)
|
|> Enum.find(&Runner.koan?/1)
|
||||||
|
|||||||
Reference in New Issue
Block a user