Sfoglia il codice sorgente

Path-type sensitive .cmd creation

pull/1500/head
Fred Hebert 8 anni fa
parent
commit
9f28bbe3c7
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. +4
    -1
      src/rebar_prv_escriptize.erl

+ 4
- 1
src/rebar_prv_escriptize.erl Vedi File

@ -266,9 +266,12 @@ rm_newline(String) ->
[C || C <- String, C =/= $\n]. [C || C <- String, C =/= $\n].
write_windows_script(Target) -> write_windows_script(Target) ->
CmdPath = if is_binary(Target) -> <<Target/binary, ".cmd">>;
is_list(Target) -> Target ++ ".cmd"
end,
CmdScript= CmdScript=
"@echo off\r\n" "@echo off\r\n"
"setlocal\r\n" "setlocal\r\n"
"set rebarscript=%~f0\r\n" "set rebarscript=%~f0\r\n"
"escript.exe \"%rebarscript:.cmd=%\" %*\r\n", "escript.exe \"%rebarscript:.cmd=%\" %*\r\n",
ok = file:write_file(Target ++ ".cmd", CmdScript).
ok = file:write_file(CmdPath, CmdScript).

Caricamento…
Annulla
Salva