Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes handling of multiple input files #38

Merged
merged 1 commit into from
Oct 30, 2022

Conversation

antedeguemon
Copy link
Contributor

Hey there! 🖖

The mix recode task fails when multiple files are passed to it:

mix recode file_1.exs file_2.exs
** (Mix) ["file_1.exs", "file_2.exs"] : Unknown

This pull request fix it by updating the task to handle multiple inputs properly.

@coveralls
Copy link

Pull Request Test Coverage Report for Build ebd0dbcfa740cc3c7029fc21786c0662bd0f927c-PR-38

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 90.033%

Totals Coverage Status
Change from base Build 780e88c9030928df9b9a3d74a1a21fd06f5f5f6a: -0.02%
Covered Lines: 551
Relevant Lines: 612

💛 - Coveralls

@@ -85,8 +85,7 @@ defmodule Mix.Tasks.Recode do
defp opts!(opts) do
case OptionParser.parse!(opts, @opts) do
{opts, []} -> opts
{opts, [inputs]} -> Keyword.put(opts, :inputs, inputs)
{_opts, args} -> Mix.raise("#{inspect(args)} : Unknown")
Copy link
Contributor Author

@antedeguemon antedeguemon Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there already is a OptionParser.parse! call that checks for unknown arguments - before getting to this line.

This Mix.raise/1 was only called when there were multiple input files.

So this line can be safely removed. 😸

@NickNeck
Copy link
Member

Thank you.

@NickNeck NickNeck merged commit 61a36ae into hrzndhrn:main Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants