소스 검색

Merge pull request #1473 from ferd/global-plugin-tpl-support

Add support for global plugin-defined templates
pull/1497/head
Fred Hebert 8 년 전
committed by GitHub
부모
커밋
4730440dfe
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. +11
    -0
      src/rebar_templater.erl

+ 11
- 0
src/rebar_templater.erl 파일 보기

@ -334,8 +334,19 @@ find_plugin_templates(State) ->
|| App <- rebar_state:all_plugin_deps(State),
Priv <- [rebar_app_info:priv_dir(App)],
Priv =/= undefined,
File <- rebar_utils:find_files(Priv, ?TEMPLATE_RE)]
++ %% and add global plugins too
[{plugin, File}
|| PSource <- rebar_state:get(State, {plugins, global}, []),
Plugin <- [plugin_provider(PSource)],
is_atom(Plugin),
Priv <- [code:priv_dir(Plugin)],
Priv =/= undefined,
File <- rebar_utils:find_files(Priv, ?TEMPLATE_RE)].
plugin_provider(P) when is_atom(P) -> P;
plugin_provider(T) when is_tuple(T) -> element(1, T).
%% Take an existing list of templates and tag them by name the way
%% the user would enter it from the CLI
tag_names(List) ->

불러오는 중...
취소
저장