aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-07-20 17:11:35 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-07-20 17:11:35 +0300
commit76b0870496f5fc93262e7dbd67adb17e001cd81a (patch)
tree1d342715fb64c61f25cca691097321a6d957d232 /lib
parent42c539b4ca6881746d0e4c3574c1955c6e806ae5 (diff)
downloadpleroma-76b0870496f5fc93262e7dbd67adb17e001cd81a.tar.gz
Return web install
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/tasks/pleroma/frontend.ex22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/mix/tasks/pleroma/frontend.ex b/lib/mix/tasks/pleroma/frontend.ex
index a17e875d0..2f4bdf1b4 100644
--- a/lib/mix/tasks/pleroma/frontend.ex
+++ b/lib/mix/tasks/pleroma/frontend.ex
@@ -147,10 +147,26 @@ defmodule Mix.Tasks.Pleroma.Frontend do
%{status: 200, body: json} = Tesla.get!(http_client(), url)
- %{"name" => ref, "commit" => %{"short_id" => last_commit_ref}} =
- Enum.find(json, & &1["default"])
+ %{"commit" => %{"short_id" => last_commit_ref}} = Enum.find(json, & &1["default"])
- %{"ref" => ref, "url" => build_url(frontend, last_commit_ref)}
+ %{"ref" => last_commit_ref, "url" => build_url(frontend, last_commit_ref)}
+ end
+
+ # fallback to develop version if compatible stable ref is not defined in
+ # mix.exs for the given frontend
+ defp get_frontend_metadata(frontend, @ref_stable) do
+ ref =
+ Map.get(
+ Pleroma.Application.frontends(),
+ frontend,
+ get_frontend_metadata(frontend, @ref_develop)
+ )
+
+ %{"ref" => ref, "url" => build_url(frontend, ref)}
+ end
+
+ defp get_frontend_metadata(frontend, ref) do
+ %{"ref" => ref, "url" => build_url(frontend, ref)}
end
defp project_url(frontend),