From 1f6d861ababc5bead8cf75e0d0ee63f33798f42a Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Tue, 16 Feb 2010 07:05:29 -0700 Subject: Overhaul env expansion so that rebar fully expands env refs prior to invoking the shell script. Also now using DRV_* env vars for compilation/linking of files found in c_src; this frees up "normal" CFLAGS/LDFLAGS for usage in sub build scripts. --- src/rebar_utils.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/rebar_utils.erl') diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 1e99caa..32a2261 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -35,7 +35,8 @@ find_files/2, now_str/0, ensure_dir/1, - beam_to_mod/2, beams/1]). + beam_to_mod/2, beams/1, + abort/2]). -include("rebar.hrl"). @@ -92,7 +93,7 @@ find_files(Dir, Regex) -> now_str() -> {{Year, Month, Day}, {Hour, Minute, Second}} = calendar:local_time(), - lists:flatten(io_lib:format("~4b/~2..0b/~2..0b ~2..0b:~2..0b:~2..0b", + lists:flatten(io_lib:format("~4b/~2..0b/~2..0b ~2..0b:~2..0b:~2..0b", [Year, Month, Day, Hour, Minute, Second])). %% TODO: Review why filelib:ensure_dir/1 sometimes returns {error, eexist}. @@ -113,6 +114,10 @@ ensure_dir(Path) -> Error end. +abort(String, Args) -> + ?ERROR(String, Args), + halt(1). + %% ==================================================================== %% Internal functions %% ==================================================================== -- cgit v1.1