Skip to content

Commit

Permalink
Fix GenCheck command
Browse files Browse the repository at this point in the history
Refs #936
  • Loading branch information
rrrene committed Feb 13, 2022
1 parent 82feb6f commit 3764952
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/credo/cli/command/gen.check.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ defmodule Credo.CLI.Command.GenCheck do

@doc false
def call(exec, _opts) do
exec.cli_options.args
|> List.first()
|> create_check_file
check_file =
case exec.cli_options do
%Credo.CLI.Options{args: [], switches: %{files_included: [single_file]}} ->
single_file

%Credo.CLI.Options{args: [single_file]} ->
single_file

_ ->
nil
end

create_check_file(check_file)

exec
end
Expand Down

0 comments on commit 3764952

Please sign in to comment.