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