From d100cad29a987641a625b6342fb1ae280595a7f0 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Fri, 6 Nov 2020 20:41:17 +0800 Subject: [PATCH] =?UTF-8?q?=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sync/esUtils.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sync/esUtils.erl b/src/sync/esUtils.erl index 6d59bb8..12ff575 100644 --- a/src/sync/esUtils.erl +++ b/src/sync/esUtils.erl @@ -105,16 +105,16 @@ tryGetSrcOptions(SrcDir) -> fun(OneFiles, Acc) -> Mod = binary_to_atom(filename:basename(OneFiles, filename:extension(OneFiles))), case getModOptions(Mod) of - {ok, Options} -> - throw({ok, Options}); + {ok, _Options} = Opts -> + throw(Opts); _ -> Acc end end, undefined) catch - {ok, Options} -> + {ok, Options} = Opts -> setOptions(SrcDir, Options), - {ok, Options}; + Opts; _ExType:_Error -> Msg = [io_lib:format("looking src options error ~p:~p. ~n", [_ExType, _Error])], logWarnings(Msg), @@ -193,14 +193,14 @@ getFileType(Source) -> determineIncludeDir(IncludeDir, BeamDir, SrcDir) -> IncludeBase = filename:basename(IncludeDir), case determineIncludeDirFromBeamDir(IncludeBase, IncludeDir, BeamDir) of - {ok, D} -> {ok, D}; + {ok, _Dir} = RetD -> RetD; undefined -> {ok, Cwd} = file:get_cwd(), % Cwd2 = normalizeCaseWindowsDir(Cwd), % SrcDir2 = normalizeCaseWindowsDir(SrcDir), % IncludeBase2 = normalizeCaseWindowsDir(IncludeBase), case findIncludeDirFromAncestors(SrcDir, Cwd, IncludeBase) of - {ok, D} -> {ok, D}; + {ok, _Dir} = RetD -> RetD; undefined -> {ok, IncludeDir} %% Failed, just stick with original end end.