Error out early if invalid paramter is provided.
This commit is contained in:
@@ -9,11 +9,21 @@ defmodule Mix.Tasks.Meditate do
|
||||
|
||||
Options.start(args)
|
||||
|
||||
modules = Runner.modules_to_run
|
||||
Tracker.start(modules)
|
||||
Runner.run(modules)
|
||||
Options.initial_koan
|
||||
|> ok?
|
||||
|> Runner.modules_to_run
|
||||
|> Tracker.start
|
||||
|> Runner.run
|
||||
|
||||
:timer.sleep(:infinity)
|
||||
end
|
||||
|
||||
defp ok?(koan) do
|
||||
if Runner.koan?(koan) do
|
||||
koan
|
||||
else
|
||||
Display.invalid_koan(koan, Runner.modules)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@@ -5,6 +5,7 @@ defmodule Tracker do
|
||||
|> Enum.count
|
||||
|
||||
Agent.start_link(fn -> {total, MapSet.new()} end, name: __MODULE__)
|
||||
modules
|
||||
end
|
||||
|
||||
def get do
|
||||
|
Reference in New Issue
Block a user