From 96c1ceba6007551812add22d585f46256d78e106 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Fri, 12 Feb 2010 15:05:32 -0700 Subject: Break out arch string function; update ERLANG_TARGET to include bitness of the Erlang target --- src/rebar_utils.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/rebar_utils.erl') diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 1aff1a4..1e99caa 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -28,6 +28,7 @@ -export([get_cwd/0, is_arch/1, + get_arch/0, get_os/0, sh/2, sh/3, sh_failfast/2, @@ -48,15 +49,17 @@ get_cwd() -> is_arch(ArchRegex) -> - Words = integer_to_list(8 * erlang:system_info(wordsize)), - Arch = erlang:system_info(system_architecture) ++ "-" ++ Words, - case re:run(Arch, ArchRegex, [{capture, none}]) of + case re:run(get_arch(), ArchRegex, [{capture, none}]) of match -> true; nomatch -> false end. +get_arch() -> + Words = integer_to_list(8 * erlang:system_info(wordsize)), + erlang:system_info(system_architecture) ++ "-" ++ Words. + get_os() -> Arch = erlang:system_info(system_architecture), case match_first([{"linux", linux}, {"darwin", darwin}], Arch) of -- cgit v1.1