Browse Source

Fix file existence checks

pull/3/head
Tuncer Ayaz 14 years ago
parent
commit
58fd80917a
5 changed files with 5 additions and 5 deletions
  1. +1
    -1
      src/rebar_erlydtl_compiler.erl
  2. +1
    -1
      src/rebar_eunit.erl
  3. +1
    -1
      src/rebar_neotoma_compiler.erl
  4. +1
    -1
      src/rebar_rel_utils.erl
  5. +1
    -1
      src/rebar_templater.erl

+ 1
- 1
src/rebar_erlydtl_compiler.erl View File

@ -174,7 +174,7 @@ referenced_dtls1(Step, Config, Seen) ->
end, Step)),
DocRoot = option(doc_root, DtlOpts),
WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ],
Existing = [F || F <- WithPaths, filelib:is_file(F)],
Existing = [F || F <- WithPaths, filelib:is_regular(F)],
New = sets:subtract(sets:from_list(Existing), Seen),
case sets:size(New) of
0 -> Seen;

+ 1
- 1
src/rebar_eunit.erl View File

@ -195,7 +195,7 @@ is_quickcheck_avail() ->
{error, bad_name} ->
IsAvail = false;
Dir ->
IsAvail = filelib:is_file(filename:join(Dir, "eqc.hrl"))
IsAvail = filelib:is_regular(filename:join(Dir, "eqc.hrl"))
end,
erlang:put(is_quickcheck_avail, IsAvail),
?DEBUG("Quickcheck availability: ~p\n", [IsAvail]),

+ 1
- 1
src/rebar_neotoma_compiler.erl View File

@ -133,7 +133,7 @@ referenced_pegs1(Step, Config, Seen) ->
end, Step)),
DocRoot = option(doc_root, NeoOpts),
WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ],
Existing = [F || F <- WithPaths, filelib:is_file(F)],
Existing = [F || F <- WithPaths, filelib:is_regular(F)],
New = sets:subtract(sets:from_list(Existing), Seen),
case sets:size(New) of
0 -> Seen;

+ 1
- 1
src/rebar_rel_utils.erl View File

@ -33,7 +33,7 @@ is_rel_dir() ->
is_rel_dir(Dir) ->
Fname = filename:join([Dir, "reltool.config"]),
case filelib:is_file(Fname) of
case filelib:is_regular(Fname) of
true ->
{true, Fname};
false ->

+ 1
- 1
src/rebar_templater.erl View File

@ -259,7 +259,7 @@ render(Bin, Context) ->
write_file(Output, Data, Force) ->
%% determine if the target file already exists
FileExists = filelib:is_file(Output),
FileExists = filelib:is_regular(Output),
%% perform the function if we're allowed,
%% otherwise just process the next template

Loading…
Cancel
Save