aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Merritt <[email protected]>2013-02-04 18:53:09 -0800
committerEric Merritt <[email protected]>2013-02-04 18:53:09 -0800
commit60b074edbb09b43618febdf8eb50a330db2aa677 (patch)
tree372f8d01399853160384a8093328ab771137669b
parent62b4f79fa00e7cc5f44621efbd4356a582fbbfb8 (diff)
parent2558618906a221ebe3cc4b2582bf59d9d7396de5 (diff)
downloadrelx-60b074edbb09b43618febdf8eb50a330db2aa677.tar.gz
relx-60b074edbb09b43618febdf8eb50a330db2aa677.tar.bz2
relx-60b074edbb09b43618febdf8eb50a330db2aa677.zip
Merge pull request #26 from tsloughter/next
make all grabs deps if deps dir does not exist
-rw-r--r--Makefile8
-rw-r--r--src/rcl_cmd_args.erl2
-rw-r--r--src/rcl_state.erl2
-rw-r--r--src/rcl_util.erl9
4 files changed, 15 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index a7e9bb6..96e14ae 100644
--- a/Makefile
+++ b/Makefile
@@ -38,16 +38,20 @@ endif
.PHONY: all compile doc clean test dialyzer typer shell distclean pdf \
get-deps escript clean-common-test-data rebuild
-all: compile escript dialyzer test
+all: deps compile escript dialyzer test
# =============================================================================
# Rules to build the system
# =============================================================================
-get-deps:
+deps:
$(REBAR) get-deps
$(REBAR) compile
+update-deps:
+ $(REBAR) update-deps
+ $(REBAR) compile
+
compile:
$(REBAR) skip_deps=true compile
diff --git a/src/rcl_cmd_args.erl b/src/rcl_cmd_args.erl
index 973abe3..bfb63b7 100644
--- a/src/rcl_cmd_args.erl
+++ b/src/rcl_cmd_args.erl
@@ -121,7 +121,7 @@ validate_config("") ->
validate_config(Config) ->
case filelib:is_regular(Config) of
true ->
- filename:absname(Config);
+ {ok, filename:absname(Config)};
false ->
?RCL_ERROR({invalid_config_file, Config})
end.
diff --git a/src/rcl_state.erl b/src/rcl_state.erl
index ecf3115..25497f8 100644
--- a/src/rcl_state.erl
+++ b/src/rcl_state.erl
@@ -256,7 +256,7 @@ format(#state_t{log=LogState, output_dir=OutDir, lib_dirs=LibDirs,
[rcl_util:indent(Indent),
<<"state(">>, erlang:atom_to_list(Caller), <<"):\n">>,
rcl_util:indent(Indent + 1), <<"log: ">>, rcl_log:format(LogState), <<",\n">>,
- rcl_util:indent(Indent + 1), "config file: ", ConfigFile, "\n",
+ rcl_util:indent(Indent + 1), "config file: ", rcl_util:optional_to_string(ConfigFile), "\n",
rcl_util:indent(Indent + 1), "goals: \n",
[[rcl_util:indent(Indent + 2), rcl_depsolver:format_constraint(Goal), ",\n"] || Goal <- Goals],
rcl_util:indent(Indent + 1), "output_dir: ", OutDir, "\n",
diff --git a/src/rcl_util.erl b/src/rcl_util.erl
index 06d957d..a879c58 100644
--- a/src/rcl_util.erl
+++ b/src/rcl_util.erl
@@ -25,7 +25,8 @@
to_binary/1,
is_error/1,
error_reason/1,
- indent/1]).
+ indent/1,
+ optional_to_string/1]).
-define(ONE_LEVEL_INDENT, " ").
%%============================================================================
@@ -68,7 +69,11 @@ is_error({error, _}) ->
is_error(_) ->
false.
-
+%% @doc convert optional argument to empty string if undefined
+optional_to_string(undefined) ->
+ "";
+optional_to_string(Value) when is_list(Value) ->
+ Value.
%%%===================================================================
%%% Test Functions