|
@@ -21,7 +21,23 @@ start_link() ->
|
|
|
|
|
|
|
|
|
init([]) ->
|
|
|
- fs:subscribe(),
|
|
|
+ case {application:get_env(fs, backwards_compatible, false),
|
|
|
+ application:get_env(active, listen_paths, [])} of
|
|
|
+ %{true, []} -> fs:subscribe();
|
|
|
+ {true, _} ->
|
|
|
+ fs:subscribe();
|
|
|
+ {false, []} ->
|
|
|
+ fs:start_link(default_fs),
|
|
|
+ fs:subscribe();
|
|
|
+ {false, Paths} ->
|
|
|
+ lists:foldl(fun(Path, ok)->
|
|
|
+ Name = erlang:list_to_atom(Path),
|
|
|
+ fs:start_link(Name, Path),
|
|
|
+ fs:subscribe(Name),
|
|
|
+ ok
|
|
|
+ end, ok, Paths)
|
|
|
+ end,
|
|
|
+
|
|
|
erlang:process_flag(priority, low),
|
|
|
gen_server:cast(self(), recompile_all),
|
|
|
{ok, #state{last=fresh, root=fs:path()}}.
|
|
@@ -114,6 +130,8 @@ app(_App, ["priv", "windows" ++ _], _) -> skip;
|
|
|
app(_App, ["priv", "linux" ++ _], _) -> skip;
|
|
|
app(App, ["priv", "static"|_Rest], Path) ->
|
|
|
compile_skip(compile_on_static, App, _Rest, Path);
|
|
|
+app(App, ["priv", "templates"|Rest], Path) ->
|
|
|
+ compile_skip(compile_on_templates, App, Rest, Path);
|
|
|
app(App, ["priv"|Rest], Path) ->
|
|
|
compile_skip(compile_on_priv, App, Rest, Path);
|
|
|
app(App, ["include"|Rest], Path) ->
|