test: remove cuttlefish code
This commit is contained in:
parent
ae854db02d
commit
0cf5aa5611
|
@ -148,27 +148,10 @@ start_app(App, Handler) ->
|
||||||
app_path(App, filename:join(["etc", atom_to_list(App) ++ ".conf"])),
|
app_path(App, filename:join(["etc", atom_to_list(App) ++ ".conf"])),
|
||||||
Handler).
|
Handler).
|
||||||
|
|
||||||
%% TODO: get rid of cuttlefish
|
|
||||||
app_schema(App) ->
|
app_schema(App) ->
|
||||||
CuttlefishSchema = app_path(App, filename:join(["priv", atom_to_list(App) ++ ".schema"])),
|
Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
|
||||||
case filelib:is_regular(CuttlefishSchema) of
|
true = is_list(Mod:roots()),
|
||||||
true ->
|
Mod.
|
||||||
CuttlefishSchema;
|
|
||||||
false ->
|
|
||||||
Mod = list_to_atom(atom_to_list(App) ++ "_schema"),
|
|
||||||
try
|
|
||||||
true = is_list(Mod:roots()),
|
|
||||||
Mod
|
|
||||||
catch
|
|
||||||
C : E ->
|
|
||||||
error(#{app => App,
|
|
||||||
file => CuttlefishSchema,
|
|
||||||
module => Mod,
|
|
||||||
exeption => C,
|
|
||||||
reason => E
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end.
|
|
||||||
|
|
||||||
mustache_vars(App) ->
|
mustache_vars(App) ->
|
||||||
[{platform_data_dir, app_path(App, "data")},
|
[{platform_data_dir, app_path(App, "data")},
|
||||||
|
@ -208,11 +191,7 @@ read_schema_configs(Schema, ConfigFile) ->
|
||||||
|
|
||||||
generate_config(SchemaModule, ConfigFile) when is_atom(SchemaModule) ->
|
generate_config(SchemaModule, ConfigFile) when is_atom(SchemaModule) ->
|
||||||
{ok, Conf0} = hocon:load(ConfigFile, #{format => richmap}),
|
{ok, Conf0} = hocon:load(ConfigFile, #{format => richmap}),
|
||||||
hocon_schema:generate(SchemaModule, Conf0);
|
hocon_schema:generate(SchemaModule, Conf0).
|
||||||
generate_config(SchemaFile, ConfigFile) ->
|
|
||||||
{ok, Conf1} = hocon:load(ConfigFile, #{format => proplists}),
|
|
||||||
Schema = cuttlefish_schema:files([SchemaFile]),
|
|
||||||
cuttlefish_generator:map(Schema, Conf1).
|
|
||||||
|
|
||||||
-spec(stop_apps(list()) -> ok).
|
-spec(stop_apps(list()) -> ok).
|
||||||
stop_apps(Apps) ->
|
stop_apps(Apps) ->
|
||||||
|
|
Loading…
Reference in New Issue