Persist Config v0.2.4 PersistConfig View Source

Persists configuration files and puts the current app in a module attribute.

use PersistConfig

Supports the following options:

  • :app - module attribute to hold the current app, defaults to :app
  • :files - (wildcard) paths, defaults to ["config/persist*.exs"]

Option :files lists the configuration files to be persisted. These are typically imported in the config/config.exs file. For example: import_config "persist_this_config.exs".

Each entry represents a (wildcard) path relative to the root. If the list is or ends up being empty, no files are persisted.

Usage

use PersistConfig files: ["config/persist_path.exs"]
...
@path Application.get_env(@app, :path)
use PersistConfig, app :my_app
...
@my_attr Application.get_env(@my_app, :my_attr)