From fef088220cada23c8b586d4ef49eecfc30e90305 Mon Sep 17 00:00:00 2001 From: William Yang Date: Fri, 2 Sep 2022 10:06:09 +0200 Subject: [PATCH] ci(xref): handle non-existing apps/modules --- scripts/xref-check.escript | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/xref-check.escript b/scripts/xref-check.escript index e0ff1d3a7..4bf5e95f1 100755 --- a/scripts/xref-check.escript +++ b/scripts/xref-check.escript @@ -18,12 +18,16 @@ main(_) -> xref:set_default(Name, [{verbose,false}, {warnings,false}]), xref:add_release(Name, "_build/emqx/rel/emqx/lib/"), xref:add_application(Name, code:lib_dir(erts)), - [ok = xref:remove_application(Name, App) || - App <- ExclApps + [ case xref:remove_application(Name, App) of + ok -> ok; + {error, xref_base, {no_such_application, _}} -> ok + end || App <- ExclApps ], - [ok = xref:remove_module(Name, M) || - M <- ExclMods + [case xref:remove_module(Name, M) of + ok -> ok; + {error, M, _R} -> ok + end || M <- ExclMods ], ModuleInfos = xref:info(Name, modules), LibInfos = xref:info(Name, modules),