aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_util.erl
diff options
context:
space:
mode:
authorobi458 <[email protected]>2016-10-05 10:56:34 +0200
committerobi458 <[email protected]>2016-10-05 10:56:34 +0200
commitf80731ef6c9250f34dd1084c521495ea02dcf4f3 (patch)
treef6f84625aef8d1550c0b5ef24a0e3517c555713b /src/rlx_util.erl
parentcf68577c1499c64c7b154160fffe14cd57fbb6ec (diff)
downloadrelx-f80731ef6c9250f34dd1084c521495ea02dcf4f3.tar.gz
relx-f80731ef6c9250f34dd1084c521495ea02dcf4f3.tar.bz2
relx-f80731ef6c9250f34dd1084c521495ea02dcf4f3.zip
win32 cross release on unix
Diffstat (limited to 'src/rlx_util.erl')
-rw-r--r--src/rlx_util.erl27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/rlx_util.erl b/src/rlx_util.erl
index efad792..b3fc2b7 100644
--- a/src/rlx_util.erl
+++ b/src/rlx_util.erl
@@ -41,6 +41,8 @@
intensity/0,
symlink_or_copy/2]).
+-export([os_type/1]).
+
-define(DFLT_INTENSITY, high).
-define(ONE_LEVEL_INDENT, " ").
%%============================================================================
@@ -326,6 +328,31 @@ intensity() ->
Mode
end.
+os_type(State) ->
+ case include_erts_is_win32(State) of
+ true -> {win32,nt};
+ false -> os:type()
+ end.
+
+include_erts_is_win32(State) ->
+ case rlx_state:get(State, include_erts, true) of
+ true -> false;
+ false -> false;
+ Path -> is_win32_erts(Path,State)
+ end.
+
+is_win32_erts(Path,State) ->
+ case filelib:wildcard(filename:join([Path,"bin","erl.exe"])) of
+ [] -> false;
+ _ ->
+ ec_cmd_log:info(rlx_state:log(State),
+ "Including Erts is win32 ~n", []),
+ true
+ end.
+
+
+
+
%%%===================================================================
%%% Test Functions
%%%===================================================================