Conversation
whatyouhide
left a comment
There was a problem hiding this comment.
Just a couple of small comments but looks pretty good to me 💯
lib/mix/lib/mix/tasks/eval.ex
Outdated
| @moduledoc """ | ||
| Evaluates the given code. | ||
|
|
||
| mix eval "IO.puts 1 + 2" |
There was a problem hiding this comment.
Nitpick (non-blocking): Maybe we can add parens so that the Elixir code looks more "idiomatic"?
| mix eval "IO.puts 1 + 2" | |
| mix eval "IO.puts(1 + 2)" |
| @@ -0,0 +1,73 @@ | |||
| defmodule Mix.Tasks.Eval do | |||
There was a problem hiding this comment.
Question (non-blocking): Noob question: after reading the docs, my natural question would be "With mix run I can run code or files in the context of my started application, but here it seems like I can only eval code (and not run files in the context of my loaded application. How do I eval files?". 🙃
There was a problem hiding this comment.
Perfect. We definitely need to answer this question and actually explain when you would want to use this. I will improve this later.
|
💚 💙 💜 💛 ❤️ |
The goal of this task is to have an equivalent for
bin/my_app evalin releases, so developers can easily run commands that apply for both releases and regular code.My biggest concern is if the differences between
mix evalandmix runare clear in the docs, so feedback on this area is welcome!