Skip to content

Commit

Permalink
Merge from erlyshare-master
Browse files Browse the repository at this point in the history
  • Loading branch information
choptastic committed Oct 26, 2017
1 parent 2de9c1c commit 7548dbf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/sync.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{licenses, ["MIT"]},
{links, [{"Github", "https://github.com/rustyio/sync"}]},
{env, [
{discover_modules_interval, 30000},
{discover_src_dirs_interval, 30000},
{discover_modules_interval, 10000},
{discover_src_dirs_interval, 10000},
{discover_src_files_interval, 5000},
{compare_beams_interval, 2000},
{compare_src_files_interval, 1000},
Expand Down
7 changes: 4 additions & 3 deletions src/sync_scanner.erl
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,11 @@ discover_source_dirs(State, ExtraDirs) ->
%% Get the options, store under the dir...
{ok, Options} = sync_utils:get_options_from_module(X),
%% Store the options for later reference...
sync_options:set_options(SrcDir, Options),
HrlDir = proplists:get_value(i, Options, []),
HrlDir = proplists:get_value(i_list, Options, []),
Options1 = proplists:delete(i_list, Options),
sync_options:set_options(SrcDir, Options1),
%% Return the dir...
{[SrcDir|SrcAcc], [HrlDir|HrlAcc]};
{[SrcDir|SrcAcc], HrlDir ++ HrlAcc};
undefined ->
Acc
end
Expand Down
22 changes: 13 additions & 9 deletions src/sync_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,22 @@ get_options_from_module(Module) ->
%% transform `outdir'
BeamDir = filename:dirname(code:which(Module)),
Options2 = [{outdir, BeamDir} | proplists:delete(outdir, Options1)],
{ok, SrcDir} = get_src_dir_from_module(Module),
%% check if the module is a DTL template.
Type = get_filetype(Module),

%% transform `i' (Include Directory)
IncludeDirOptionList = lists:foldl(fun
(IncludeDir1, Acc) ->
Fun = fun({i, IncludeDir1}, IncludeDirList) ->
{ok, SrcDir} = get_src_dir_from_module(Module),
{ok, IncludeDir2} = determine_include_dir(IncludeDir1, BeamDir, SrcDir),
[{i,IncludeDir2} | Acc]
end, [], proplists:get_all_values(i, Options2)),
Options3 = [{type, Type} | proplists:delete(i, Options2)] ++ IncludeDirOptionList,
{ok, Options3}
[IncludeDir2 | IncludeDirList];
(_, IncludeDirList) ->
IncludeDirList
end,
IncludeDirList1 = lists:foldl(Fun, [], Options2),

%% check if the module is a DTL template.
Type = get_filetype(Module),

Options4 = [{i_list, IncludeDirList1}, {type, Type} | Options2],
{ok, Options4}
catch ExType:Error ->
Msg =
[
Expand Down

0 comments on commit 7548dbf

Please sign in to comment.