%% -*- erlang -*-
%%==============================================================================
%% Copyright 2014 Ulf Wiger
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%==============================================================================
%% config template
%% @author ulf@wiger.net


%% This file is read using file:script/2 with the following
%% variable bindings:
%% Name    Name of release
%% CWD     Current working directory</td></tr>
%% Options List of options (proplist) given to setup_gen
%%
%% The file shold contain Erlang expressions, each terminated with
%% a period and newline. The result of the last expression must be
%% a list of {Key, Value} tuples.
%%
%% It is possible to add custom config values (todo: how to make these
%% available?). Predefined config values are:
%% - {apps, [App]}
%%     App = AppName :: atom()
%%           | {AppName, Type}
%%           | {AppName, Incls}p
%%           | {AppName, Type, Incls}
%% - {nodes, [NodeName]}
%%      The names of the nodes that should be started
%% - {env, [{AppName, [{Key, Value}]}]}
%%      Add or modify application environment variables. If the given
%%      variables exist, they will be shadowed. Successive env items can
%%      correspondingly shadow those given in previous env entries.
%%      The order of defining env variables is as follows:
%%      1. Statically defined variables in the .app files
%%      2. variables defined in releases/Vsn/Relname.config
%%      3. env items in a target config like this one
%%         These are added to the Relname.config and written to
%%         releases/Vsn/sys.config
%%      4. Env variables added to the command line when starting erlang.
%% - {target_subdir, SubDir}
%%      Make all generated files appear in TargetDir/SubDir, rather than in
%%      TargetDir (argument given to make_scripts). The subdirectory will be
%%      created automatically.
%%
%% Example:
%% {ok, Host} = inet:gethostname().
%% Nodes = [list_to_atom(Name) ++ "@" ++ Host || Name <- [n1, n2]].
%% {ok, Base}= file:script("base.conf").
%% %% return the config
%% [
%%  {nodes, Nodes}
%% ] ++ Base.
