fork https://github.com/synrc/active
![]() |
1 year ago | |
---|---|---|
src | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 3 years ago | |
README.md | 1 year ago | |
mad | 1 year ago |
Active is a sync replacement that uses native file-system OS async listeners to compile and reload Erlang files, DTL templates and other files. It acts as FS subscriber under supervision and uses mad under the hood.
app(App,["ebin",Module|_]) -> load_ebin(App,Module);
app(App,["priv"|_]) -> compile(App);
app(App,["src"|_]) -> compile(App);
app(_,_)-> ok.
otp(["deps",App|Rest]) -> app(App,Rest);
otp(["apps",App|Rest]) -> app(App,Rest);
otp([Some|Path]) -> app(top(),[Some|Path]);
otp(_) -> ok.
On Mac/Linux/Windows just include into your rebar.config:
{active, ".*", {git, "https://git.4dev.win/n4u/active.git", {tag, "6.2-erl19"}}}
add next code into your sys.config
for fs listen your apps/deps dirs
and active compiling erlydtl templates in apps/yor_app/priv/templates/
{fs,
[{backwards_compatible, false}]
},
{active,
[{compile_on_templates, true},
{listen_paths, ["apps", "deps"]}
]}
NOTE: on Linux please install inotify-tools.
OM A HUM