Skip to content

Conversation

ToJans
Copy link
Contributor

@ToJans ToJans commented Jun 20, 2013

System.find_executable for rebar returns a rebar.cmd file, which should not
be wrapped by escript. We now have an extra check that verifies whether the
invoked file is indeed a cmd file.

@@ -150,8 +150,8 @@ defmodule Mix.Rebar do

defp wrap_cmd(nil), do: nil
defp wrap_cmd(rebar) do
case :os.type do
{ :win32, _ } -> "escript.exe #{rebar}"
case [:os.type,String.ends_with?(rebar,".cmd")] do
Copy link
Member

Choose a reason for hiding this comment

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

What do you think of:

if match?({ :win32, _ }, :os.type) and not String.ends_with?(rebar,".cmd") do
  "escript.exe #{rebar}"
else
  rebar
end

System.find_executable for rebar returns a rebar.cmd file, which should not
be wrapped by escript. We now have an extra check that verifies whether the
invoked file is indeed a cmd file.
josevalim pushed a commit that referenced this pull request Jun 20, 2013
Fix the rebar wrapper on windows
@josevalim josevalim merged commit 9e6b650 into elixir-lang:master Jun 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants