mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Fix rebar_core crash (reported-by: Jeremy Raymond)
This commit is contained in:
parent
58101588a1
commit
7c327c1195
1 changed files with 23 additions and 16 deletions
|
@ -115,23 +115,30 @@ process_dir(Dir, ParentConfig, Command, DirSet) ->
|
||||||
%% to process this dir.
|
%% to process this dir.
|
||||||
{ok, AvailModuleSets} = application:get_env(rebar, modules),
|
{ok, AvailModuleSets} = application:get_env(rebar, modules),
|
||||||
ModuleSet = choose_module_set(AvailModuleSets, Dir),
|
ModuleSet = choose_module_set(AvailModuleSets, Dir),
|
||||||
{_DirModules, ModuleSetFile} = ModuleSet,
|
maybe_process_dir(ModuleSet, Config, CurrentCodePath,
|
||||||
|
Dir, Command, DirSet)
|
||||||
|
end.
|
||||||
|
|
||||||
|
maybe_process_dir({[], undefined}=ModuleSet, Config, CurrentCodePath,
|
||||||
|
Dir, Command, DirSet) ->
|
||||||
|
process_dir0(Dir, Command, DirSet, Config, CurrentCodePath, ModuleSet);
|
||||||
|
maybe_process_dir({_, ModuleSetFile}=ModuleSet, Config, CurrentCodePath,
|
||||||
|
Dir, Command, DirSet) ->
|
||||||
case lists:reverse(ModuleSetFile) of
|
case lists:reverse(ModuleSetFile) of
|
||||||
"ppa." ++ _ ->
|
"ppa." ++ _ ->
|
||||||
%% .app file
|
%% .app file
|
||||||
maybe_process_dir0(ModuleSetFile, ModuleSet, Config,
|
maybe_process_dir0(ModuleSetFile, ModuleSet,
|
||||||
CurrentCodePath, Dir,
|
Config, CurrentCodePath, Dir,
|
||||||
Command, DirSet);
|
Command, DirSet);
|
||||||
"crs.ppa." ++ _ ->
|
"crs.ppa." ++ _ ->
|
||||||
%% .app.src file
|
%% .app.src file
|
||||||
maybe_process_dir0(ModuleSetFile, ModuleSet, Config,
|
maybe_process_dir0(ModuleSetFile, ModuleSet,
|
||||||
CurrentCodePath, Dir,
|
Config, CurrentCodePath, Dir,
|
||||||
Command, DirSet);
|
Command, DirSet);
|
||||||
_ ->
|
_ ->
|
||||||
|
%% not an app dir, no need to consider apps=/skip_apps=
|
||||||
process_dir0(Dir, Command, DirSet, Config,
|
process_dir0(Dir, Command, DirSet, Config,
|
||||||
CurrentCodePath, ModuleSet)
|
CurrentCodePath, ModuleSet)
|
||||||
end
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
maybe_process_dir0(AppFile, ModuleSet, Config, CurrentCodePath,
|
maybe_process_dir0(AppFile, ModuleSet, Config, CurrentCodePath,
|
||||||
|
|
Loading…
Reference in a new issue