You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI cannot accept a path input, though its help and the compiler both support one #501
usage: elixirscript <module | path> [options]
<path> the path to .ex(s) files to compile
ElixirScript.Compiler.compile/2 does support it — def compile(path, opts) when is_binary(path) plus the Path.wildcard/1 handling was added by #420 — but the CLI never passes a path through, because handle_input/1 maps every argument token through Module.concat/1:
So a path becomes an atom, the when is_binary(path) clause is unreachable from the CLI, and the compile aborts:
$ mix run -e 'ElixirScript.CLI.process({["test/fixtures/list_ops.ex"], []})'
[warn] ElixirScript: :"Elixir.test/fixtures/list_ops.ex" is missing or unavailable
** (MatchError) no match of right hand side value: nil
lib/elixir_script/passes/find_used_functions.ex:36: ElixirScript.FindUsedFunctions.walk_module/2
Passing the same path straight to the compiler works, so only the CLI wiring is missing.
Reproduced on cc8a08a with Elixir 1.11.4 / OTP 23.
Filed as an issue rather than a PR because a fix needs a disambiguation rule: a bare token can be either a module name or a relative path (Atom vs ./Atom, my/path vs My.Path), so "treat it as a path when it names an existing file or directory" is a behaviour change worth agreeing on first.
Activity