From d538be3481e65a00f2817344f697f88b1b55f8c3 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Fri, 5 Oct 2018 10:57:58 -0400 Subject: Bump bbmustache and fix templates (#1862) * bump bbmustache to version 1.6.0 * Use alternative bbmustache brackets in templates This fixes the problems where literal nested tuples (`{{a,b},c}` or `{{a,b}}`) would blow up and spaces needed to be inserted. --- priv/templates/otp_app.app.src | 7 ++++--- priv/templates/plugin_README.md | 13 +++++++------ priv/templates/relx_rebar.config | 5 +++-- priv/templates/sup.erl | 7 ++++--- priv/templates/sys.config | 3 ++- 5 files changed, 20 insertions(+), 15 deletions(-) (limited to 'priv') diff --git a/priv/templates/otp_app.app.src b/priv/templates/otp_app.app.src index d694d87..6040089 100644 --- a/priv/templates/otp_app.app.src +++ b/priv/templates/otp_app.app.src @@ -1,8 +1,9 @@ -{application, {{name}}, - [{description, "{{desc}}"}, +{{=@@ @@=}} +{application, @@name@@, + [{description, "@@desc@@"}, {vsn, "0.1.0"}, {registered, []}, - {mod, { {{name}}_app, []}}, + {mod, {@@name@@_app, []}}, {applications, [kernel, stdlib diff --git a/priv/templates/plugin_README.md b/priv/templates/plugin_README.md index 7f9ba84..1176d95 100644 --- a/priv/templates/plugin_README.md +++ b/priv/templates/plugin_README.md @@ -1,7 +1,8 @@ -{{name}} +{{=@@ @@=}} +@@name@@ ===== -{{desc}} +@@desc@@ Build ----- @@ -14,13 +15,13 @@ Use Add the plugin to your rebar config: {plugins, [ - { {{name}}, ".*", {git, "git@host:user/{{name}}.git", {tag, "0.1.0"}}} + {@@name@@, {git, "https://host/user/@@name@@.git", {tag, "0.1.0"}}} ]}. Then just call your plugin directly in an existing application: - $ rebar3 {{name}} - ===> Fetching {{name}} - ===> Compiling {{name}} + $ rebar3 @@name@@ + ===> Fetching @@name@@ + ===> Compiling @@name@@ diff --git a/priv/templates/relx_rebar.config b/priv/templates/relx_rebar.config index 81b7dbe..30a629f 100644 --- a/priv/templates/relx_rebar.config +++ b/priv/templates/relx_rebar.config @@ -1,8 +1,9 @@ +{{=@@ @@=}} {erl_opts, [debug_info]}. {deps, []}. -{relx, [{release, { {{name}}, "0.1.0" }, - [{{name}}, +{relx, [{release, {@@name@@, "0.1.0"}, + [@@name@@, sasl]}, {sys_config, "./config/sys.config"}, diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index 0db7155..020021c 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -1,9 +1,10 @@ +{{=@@ @@=}} %%%------------------------------------------------------------------- -%% @doc {{name}} top level supervisor. +%% @doc @@name@@ top level supervisor. %% @end %%%------------------------------------------------------------------- --module({{name}}_sup). +-module(@@name@@_sup). -behaviour(supervisor). @@ -31,7 +32,7 @@ start_link() -> %% Before OTP 18 tuples must be used to specify a child. e.g. %% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} init([]) -> - {ok, { {one_for_all, 0, 1}, []} }. + {ok, {{one_for_all, 0, 1}, []}}. %%==================================================================== %% Internal functions diff --git a/priv/templates/sys.config b/priv/templates/sys.config index d892fd6..983801f 100644 --- a/priv/templates/sys.config +++ b/priv/templates/sys.config @@ -1,3 +1,4 @@ +{{=@@ @@=}} [ - { {{name}}, []} + {@@name@@, []} ]. -- cgit v1.1