diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-12-18 13:29:58 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-12-18 13:29:58 +0100 |
commit | 7c327c119533b126b65a31534bfdccded0afff75 (patch) | |
tree | 369e72f8da38639c8f0651f4d6504304f2024b44 /src | |
parent | 58101588a13a9691214440f0c90691322dc68696 (diff) |
Fix rebar_core crash (reported-by: Jeremy Raymond)
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_core.erl | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 44ad355..56b32f2 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -115,23 +115,30 @@ process_dir(Dir, ParentConfig, Command, DirSet) -> %% to process this dir. {ok, AvailModuleSets} = application:get_env(rebar, modules), ModuleSet = choose_module_set(AvailModuleSets, Dir), - {_DirModules, ModuleSetFile} = ModuleSet, - - case lists:reverse(ModuleSetFile) of - "ppa." ++ _ -> - %% .app file - maybe_process_dir0(ModuleSetFile, ModuleSet, Config, - CurrentCodePath, Dir, - Command, DirSet); - "crs.ppa." ++ _ -> - %% .app.src file - maybe_process_dir0(ModuleSetFile, ModuleSet, Config, - CurrentCodePath, Dir, - Command, DirSet); - _ -> - process_dir0(Dir, Command, DirSet, Config, - CurrentCodePath, ModuleSet) - end + 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 + "ppa." ++ _ -> + %% .app file + maybe_process_dir0(ModuleSetFile, ModuleSet, + Config, CurrentCodePath, Dir, + Command, DirSet); + "crs.ppa." ++ _ -> + %% .app.src file + maybe_process_dir0(ModuleSetFile, ModuleSet, + Config, CurrentCodePath, Dir, + Command, DirSet); + _ -> + %% not an app dir, no need to consider apps=/skip_apps= + process_dir0(Dir, Command, DirSet, Config, + CurrentCodePath, ModuleSet) end. maybe_process_dir0(AppFile, ModuleSet, Config, CurrentCodePath, |