rebar_eunit_tests: avoid repetition

This commit is contained in:
Tuncer Ayaz 2011-08-05 02:55:47 +02:00
parent e3fe1c6903
commit 4f41e742d3

View file

@ -208,10 +208,11 @@ remove_tmp_dir(_) ->
%% ==================================================================== %% ====================================================================
prepare_rebar_script() -> prepare_rebar_script() ->
{ok, _} = file:copy(?REBAR_SCRIPT, ?TMP_DIR ++ "rebar"), Rebar = ?TMP_DIR ++ "rebar",
{ok, _} = file:copy(?REBAR_SCRIPT, Rebar),
case os:type() of case os:type() of
{unix, _} -> {unix, _} ->
[] = os:cmd("chmod u+x " ++ ?TMP_DIR ++ "rebar"); [] = os:cmd("chmod u+x " ++ Rebar);
{win32, _} -> {win32, _} ->
{ok, _} = file:copy(?REBAR_SCRIPT ++ ".bat", {ok, _} = file:copy(?REBAR_SCRIPT ++ ".bat",
?TMP_DIR ++ "rebar.bat") ?TMP_DIR ++ "rebar.bat")