Handle not found COMMIT.json, for example in GH Actions
This commit is contained in:
parent
033656d70e
commit
a38ed7fb2c
|
@ -752,7 +752,9 @@ find_commit_json(Attrs) ->
|
||||||
{{ok, FromFile}, _} ->
|
{{ok, FromFile}, _} ->
|
||||||
FromFile;
|
FromFile;
|
||||||
{_, {ok, FromFile}} ->
|
{_, {ok, FromFile}} ->
|
||||||
FromFile
|
FromFile;
|
||||||
|
_ ->
|
||||||
|
not_found
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-ifdef(HAVE_URI_STRING). %% Erlang/OTP 20 or higher can use this:
|
-ifdef(HAVE_URI_STRING). %% Erlang/OTP 20 or higher can use this:
|
||||||
|
@ -779,8 +781,12 @@ find_commit_json_path(Path) ->
|
||||||
|
|
||||||
copy_commit_json(Package, Attrs) ->
|
copy_commit_json(Package, Attrs) ->
|
||||||
DestPath = module_lib_dir(Package),
|
DestPath = module_lib_dir(Package),
|
||||||
FromFile = find_commit_json(Attrs),
|
case find_commit_json(Attrs) of
|
||||||
file:copy(FromFile, filename:join(DestPath, "COMMIT.json")).
|
not_found ->
|
||||||
|
ok;
|
||||||
|
FromFile ->
|
||||||
|
file:copy(FromFile, filename:join(DestPath, "COMMIT.json"))
|
||||||
|
end.
|
||||||
|
|
||||||
get_commit_details(Dirname) ->
|
get_commit_details(Dirname) ->
|
||||||
RepDir = filename:join(sources_dir(), Dirname),
|
RepDir = filename:join(sources_dir(), Dirname),
|
||||||
|
|
Loading…
Reference in New Issue