mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix file existence checks
This commit is contained in:
parent
a8870807fc
commit
58fd80917a
5 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -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]),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 ->
|
||||
|
|
|
@ -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…
Reference in a new issue