diff options
| author | Fred Hebert <mononcqc@ferd.ca> | 2017-02-28 07:47:11 -0500 | 
|---|---|---|
| committer | Fred Hebert <mononcqc@ferd.ca> | 2017-02-28 07:47:11 -0500 | 
| commit | 9f28bbe3c735c5cc0c670bfe0cb6559ff028680e (patch) | |
| tree | 32f049f5cbe7e26a7e8007da43c2c9efc2ccf195 /src | |
| parent | 55b4b761af69f553bf482f403788e0edd28165e2 (diff) | |
Path-type sensitive .cmd creation
Diffstat (limited to 'src')
| -rw-r--r-- | src/rebar_prv_escriptize.erl | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/src/rebar_prv_escriptize.erl b/src/rebar_prv_escriptize.erl index 5c0c989..56b0d8a 100644 --- a/src/rebar_prv_escriptize.erl +++ b/src/rebar_prv_escriptize.erl @@ -266,9 +266,12 @@ rm_newline(String) ->      [C || C <- String, C =/= $\n].  write_windows_script(Target) -> +    CmdPath = if is_binary(Target) -> <<Target/binary, ".cmd">>; +                 is_list(Target) -> Target ++ ".cmd" +              end,      CmdScript=          "@echo off\r\n"          "setlocal\r\n"          "set rebarscript=%~f0\r\n"          "escript.exe \"%rebarscript:.cmd=%\" %*\r\n", -    ok = file:write_file(Target ++ ".cmd", CmdScript). +    ok = file:write_file(CmdPath, CmdScript). | 
