Skip to content

Commit d12e687

Browse files
committed
simplify code
1 parent 110c7d6 commit d12e687

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/rabbit_ct_config_schema.erl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ init_schemas(App, Config) ->
4545
]).
4646

4747
find_app_schema(App, DepsDir) ->
48-
Schema = filename:join([DepsDir, App, "priv", get_schema_for(App)]),
48+
Schema = get_schema_for([DepsDir, App, "priv"], App),
4949
does_schema_exist(filelib:is_regular(Schema), App, DepsDir, Schema, cont).
5050

5151
does_schema_exist(true, _App, _DepsDir, Schema, _) ->
@@ -54,12 +54,11 @@ does_schema_exist(false, App, _DepsDir, _Schema, stop) ->
5454
ct:fail("Could not find schema for app: ~p~n", [App]);
5555
does_schema_exist(false, App, DepsDir, _Schema, cont) ->
5656
% If not in umbrella, priv will be at ../priv
57-
PrivDir = filename:join([DepsDir, "..", "priv"]),
58-
Schema = filename:join([PrivDir, get_schema_for(App)]),
57+
Schema = get_schema_for([DepsDir, "..", "priv"], App),
5958
does_schema_exist(filelib:is_regular(Schema), App, DepsDir, Schema, stop).
6059

61-
get_schema_for(App) ->
62-
filename:join(["schema", atom_to_list(App) ++ ".schema"]).
60+
get_schema_for(Prefix, App) ->
61+
filename:join(Prefix ++ ["schema", atom_to_list(App) ++ ".schema"]).
6362

6463
copy_to(File, Dir) ->
6564
BaseName = filename:basename(File),

0 commit comments

Comments
 (0)