소스 검색

Merge pull request #2321 from pablocostass/fix_keep_logs_pattern_match

Add extra pattern matching clause to not crash handling with keep_logs
pull/2325/head
Fred Hebert 4 년 전
committed by GitHub
부모
커밋
a5bfc23f4b
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. +5
    -2
      src/rebar_prv_common_test.erl

+ 5
- 2
src/rebar_prv_common_test.erl 파일 보기

@ -699,13 +699,16 @@ handle_keep_logs(LogDir, N) ->
case Dirs of
%% first time running the tests, there are no logs to delete
[] -> ok;
_ ->
%% during the next run we would crash because of keep_logs
_ when length(Dirs) >= N ->
SortedDirs = lists:reverse(lists:sort(Dirs)),
%% sort the log dirs and keep the N - 1 newest
{_Keep, Discard} = lists:split(N - 1, SortedDirs),
?DEBUG("Removing the following directories because keep_logs option was found: ~p", [Discard]),
[rebar_file_utils:rm_rf(filename:join([LogDir, Dir])) || Dir <- Discard],
ok
ok;
%% we still dont have enough log run directories as to crash
_ -> ok
end;
_ -> ok
end.

불러오는 중...
취소
저장