From 9f28bbe3c735c5cc0c670bfe0cb6559ff028680e Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Tue, 28 Feb 2017 07:47:11 -0500 Subject: Path-type sensitive .cmd creation --- src/rebar_prv_escriptize.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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) -> <>; + 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). -- cgit v1.1