summaryrefslogtreecommitdiff
path: root/src/rebar_utils.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-02-21 12:56:47 -0600
committerTristan Sloughter <t@crashfast.com>2015-02-22 11:02:36 -0600
commit8f03afded4dbb046bacb241bd66a603dee4a3e40 (patch)
tree915e1e1f4fc52330f8c40f5de3f94f22dc337191 /src/rebar_utils.erl
parent48278658bb73c529ebf300c10a67e3f168b30ea8 (diff)
consolidate app validation and exist checks
Diffstat (limited to 'src/rebar_utils.erl')
-rw-r--r--src/rebar_utils.erl21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 943c0d7..b3ae9ff 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -43,7 +43,7 @@
beams/1,
find_executable/1,
expand_code_path/0,
- vcs_vsn/3,
+ vcs_vsn/2,
deprecated/3,
deprecated/4,
erl_opts/1,
@@ -179,19 +179,6 @@ expand_code_path() ->
end, [], code:get_path()),
code:set_path(lists:reverse(CodePath)).
-vcs_vsn(Config, Vsn, Dir) ->
- Key = {Vsn, Dir},
- Cache = rebar_state:get(Config, vsn_cache, dict:new()),
- case dict:find(Key, Cache) of
- error ->
- VsnString = vcs_vsn_1(Vsn, Dir),
- Cache1 = dict:store(Key, VsnString, Cache),
- Config1 = rebar_state:set(Config, vsn_cache, Cache1),
- {Config1, VsnString};
- {ok, VsnString} ->
- {Config, VsnString}
- end.
-
deprecated(Old, New, Opts, When) when is_list(Opts) ->
case lists:member(Old, Opts) of
true ->
@@ -413,16 +400,16 @@ escript_foldl(Fun, Acc, File) ->
Error
end.
-vcs_vsn_1(Vcs, Dir) ->
+vcs_vsn(Vcs, Dir) ->
case vcs_vsn_cmd(Vcs, Dir) of
{plain, VsnString} ->
VsnString;
{cmd, CmdString} ->
vcs_vsn_invoke(CmdString, Dir);
unknown ->
- ?ABORT("vcs_vsn: Unknown vsn format: ~p\n", [Vcs]);
+ ?ABORT("vcs_vsn: Unknown vsn format: ~p", [Vcs]);
{error, Reason} ->
- ?ABORT("vcs_vsn: ~s\n", [Reason])
+ ?ABORT("vcs_vsn: ~s", [Reason])
end.
%% Temp work around for repos like relx that use "semver"