summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2022-07-27 12:29:06 +0200
committerBadlop <badlop@process-one.net>2022-07-27 15:16:49 +0200
commita38ed7fb2c79e849ddb0767fe7c3ad38afdd74b0 (patch)
tree87adb46a125caba2c65c714689e598a32c4ce289 /src
parentAdd WebAdmin page for managing external modules (diff)
Handle not found COMMIT.json, for example in GH Actions
Diffstat (limited to 'src')
-rw-r--r--src/ext_mod.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ext_mod.erl b/src/ext_mod.erl
index e4330e3a..df2d0c67 100644
--- a/src/ext_mod.erl
+++ b/src/ext_mod.erl
@@ -752,7 +752,9 @@ find_commit_json(Attrs) ->
{{ok, FromFile}, _} ->
FromFile;
{_, {ok, FromFile}} ->
- FromFile
+ FromFile;
+ _ ->
+ not_found
end.
-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) ->
DestPath = module_lib_dir(Package),
- FromFile = find_commit_json(Attrs),
- file:copy(FromFile, filename:join(DestPath, "COMMIT.json")).
+ case find_commit_json(Attrs) of
+ not_found ->
+ ok;
+ FromFile ->
+ file:copy(FromFile, filename:join(DestPath, "COMMIT.json"))
+ end.
get_commit_details(Dirname) ->
RepDir = filename:join(sources_dir(), Dirname),