Skip to content

Commit 6851b42

Browse files
authored
Remove Validation for mix.exs in the project path (#112)
The project searches recursively, there's no requirement for a top level mix.exs
1 parent fa66011 commit 6851b42

File tree

1 file changed

+1
-12
lines changed
  • lib/mix_dependency_submission

1 file changed

+1
-12
lines changed

lib/mix_dependency_submission/cli.ex

+1-12
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule MixDependencySubmission.CLI do
4545
short: "-p",
4646
long: "--project-path",
4747
help: "Path to the project. (`directory` with `mix.exs`)",
48-
parser: &parse_project_path/1,
48+
parser: &parse_directory/1,
4949
default: &File.cwd!/0
5050
],
5151
paths_relative_to: [
@@ -117,17 +117,6 @@ defmodule MixDependencySubmission.CLI do
117117
]
118118
end
119119

120-
@spec parse_project_path(path :: String.t()) :: Optimus.parser_result()
121-
defp parse_project_path(path) do
122-
with {:ok, path} <- parse_directory(path),
123-
true <- path |> Path.join("mix.exs") |> File.regular?() do
124-
{:ok, Path.absname(path)}
125-
else
126-
{:error, reason} -> {:error, reason}
127-
false -> {:error, "invalid path"}
128-
end
129-
end
130-
131120
@spec parse_directory(path :: String.t()) :: Optimus.parser_result()
132121
defp parse_directory(path) do
133122
if File.dir?(path) do

0 commit comments

Comments
 (0)