diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-20 18:33:36 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-20 18:33:36 +0200 |
commit | e6d1e13966bdd130a34d9ad8cebbaee34f91094c (patch) | |
tree | 3ea4bb5924a2a5a0c5ae4bfc746d04d74083bc08 | |
parent | 8fb385f31240fe1fded07bd3468b21aa10c19be9 (diff) |
Apply Tidier suggestions
-rw-r--r-- | src/rebar_eunit.erl | 16 | ||||
-rw-r--r-- | src/rebar_utils.erl | 7 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index d42ed1f..c15e934 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -291,17 +291,17 @@ cover_init(true, BeamFiles) -> %% to stdout. If the cover server is already started we'll reuse that %% pid. {ok, CoverPid} = case cover:start() of - {ok, P} -> - {ok, P}; + {ok, _P} = OkStart -> + OkStart; {error,{already_started, P}} -> {ok, P}; - {error, Reason} -> - {error, Reason} + {error, _Reason} = ErrorStart -> + ErrorStart end, - {ok, F} = file:open( - filename:join([?EUNIT_DIR, "cover.log"]), - [write]), + {ok, F} = OkOpen = file:open( + filename:join([?EUNIT_DIR, "cover.log"]), + [write]), group_leader(F, CoverPid), @@ -327,7 +327,7 @@ cover_init(true, BeamFiles) -> [Beam, Desc]) end, _ = [PrintWarning(Beam, Desc) || {Beam, {error, Desc}} <- Compiled], - {ok, F} + OkOpen end; cover_init(Config, BeamFiles) -> cover_init(rebar_config:get(Config, cover_enabled, false), BeamFiles). diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 8db2df2..ca254eb 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -187,13 +187,12 @@ expand_code_path() -> %% The end of form $FOO is delimited with whitespace or eol %% expand_env_variable(InStr, VarName, RawVarValue) -> - VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", - [global, {return, list}]), + ReOpts = [global, {return, list}], + VarValue = re:replace(RawVarValue, "\\\\", "\\\\\\\\", ReOpts), R1 = re:replace(InStr, "\\\$" ++ VarName ++ "\\s", VarValue ++ " ", [global]), R2 = re:replace(R1, "\\\$" ++ VarName ++ "\$", VarValue), - re:replace(R2, "\\\${" ++ VarName ++ "}", VarValue, - [global, {return, list}]). + re:replace(R2, "\\\${" ++ VarName ++ "}", VarValue, ReOpts). %% ==================================================================== |