summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-02-28 07:53:48 -0500
committerGitHub <noreply@github.com>2017-02-28 07:53:48 -0500
commit9e8256ba73770d15fc038271f96bdd1b2128cde9 (patch)
tree32f049f5cbe7e26a7e8007da43c2c9efc2ccf195 /src
parent55b4b761af69f553bf482f403788e0edd28165e2 (diff)
parent9f28bbe3c735c5cc0c670bfe0cb6559ff028680e (diff)
Merge pull request #1500 from ferd/fix-win-tests
Path-type sensitive .cmd creation
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_escriptize.erl5
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).