From c5ae9f3fed035d2ef8f072da53647c212f92db8b Mon Sep 17 00:00:00 2001 From: Grigory Starinkin Date: Tue, 8 May 2018 21:42:43 +0100 Subject: start at least one async thread in async thread pool fixes an issue when shell is terminated with an error "Bus error: 10", on attempt to run rebar shell with verbose logging --- priv/templates/escript_rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv') diff --git a/priv/templates/escript_rebar.config b/priv/templates/escript_rebar.config index ef498a8..3ed7150 100644 --- a/priv/templates/escript_rebar.config +++ b/priv/templates/escript_rebar.config @@ -5,7 +5,7 @@ [{{name}}]}. {escript_main_app, {{name}}}. {escript_name, {{name}}}. -{escript_emu_args, "%%! +sbtu +A0\n"}. +{escript_emu_args, "%%! +sbtu +A1\n"}. %% Profiles {profiles, [{test, -- cgit v1.1 From 6bcbbf7526a9ac426e627826f5304ed1c3051f2a Mon Sep 17 00:00:00 2001 From: Peter Saxton Date: Sun, 20 May 2018 15:50:48 +0100 Subject: Use maps for child spec example --- priv/templates/sup.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'priv') diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index a2e7209..e2fa05e 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -26,7 +26,8 @@ start_link() -> %% Supervisor callbacks %%==================================================================== -%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} +%% Child :: #{id => Id, start => {M, F, A}} +%% Optional keys are restart, shutdown, type, modules. init([]) -> {ok, { {one_for_all, 0, 1}, []} }. -- cgit v1.1 From 0a0539ae2aad4f4d227927e0c205b8aef7ab9acc Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 20 May 2018 11:08:08 -0400 Subject: Auto-boot main app in OTP app project templates People are starting to expect these niceties! It's also easier to drop the config when you know it's there than add it when you don't know it exists. --- priv/templates/app.template | 2 +- priv/templates/app_rebar.config | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 priv/templates/app_rebar.config (limited to 'priv') diff --git a/priv/templates/app.template b/priv/templates/app.template index d0bebd7..7d68b2c 100644 --- a/priv/templates/app.template +++ b/priv/templates/app.template @@ -6,7 +6,7 @@ {template, "app.erl", "{{name}}/src/{{name}}_app.erl"}. {template, "sup.erl", "{{name}}/src/{{name}}_sup.erl"}. {template, "otp_app.app.src", "{{name}}/src/{{name}}.app.src"}. -{template, "rebar.config", "{{name}}/rebar.config"}. +{template, "app_rebar.config", "{{name}}/rebar.config"}. {template, "gitignore", "{{name}}/.gitignore"}. {template, "LICENSE", "{{name}}/LICENSE"}. {template, "README.md", "{{name}}/README.md"}. diff --git a/priv/templates/app_rebar.config b/priv/templates/app_rebar.config new file mode 100644 index 0000000..203ce4a --- /dev/null +++ b/priv/templates/app_rebar.config @@ -0,0 +1,7 @@ +{erl_opts, [debug_info]}. +{deps, []}. + +{shell, [ + % {config, [{config, "config/sys.config"}]}, + {apps, [{{name}}]} +]}. -- cgit v1.1 From 1b02e78fae8a50b77a7b68544f00208353a23cb3 Mon Sep 17 00:00:00 2001 From: Peter Saxton Date: Sun, 20 May 2018 16:11:21 +0100 Subject: add tuple and comment for prior to OTP 18 --- priv/templates/sup.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'priv') diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index e2fa05e..0db7155 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -28,6 +28,8 @@ start_link() -> %% Child :: #{id => Id, start => {M, F, A}} %% Optional keys are restart, shutdown, type, modules. +%% 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}, []} }. -- cgit v1.1