From ab648fd95da8dd87188e97c041d8c87d3dc34753 Mon Sep 17 00:00:00 2001 From: Roman Chvanikov Date: Mon, 20 Jul 2020 21:22:23 +0300 Subject: Fix admin FE build instructions --- lib/mix/tasks/pleroma/frontend.ex | 11 ++++++++--- test/tasks/frontend_test.exs | 6 +++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/mix/tasks/pleroma/frontend.ex b/lib/mix/tasks/pleroma/frontend.ex index 40486587d..f953fd005 100644 --- a/lib/mix/tasks/pleroma/frontend.ex +++ b/lib/mix/tasks/pleroma/frontend.ex @@ -115,9 +115,15 @@ defmodule Mix.Tasks.Pleroma.Frontend do end end + defp build_frontend("admin", path) do + {_out, 0} = System.cmd("yarn", [], cd: path) + {_out, 0} = System.cmd("yarn", ["build:prod"], cd: path) + :ok + end + defp build_frontend(_frontend, path) do - System.cmd("yarn", [], cd: path) - System.cmd("yarn", ["build"], cd: path) + {_out, 0} = System.cmd("yarn", [], cd: path) + {_out, 0} = System.cmd("yarn", ["build"], cd: path) :ok end @@ -226,7 +232,6 @@ defmodule Mix.Tasks.Pleroma.Frontend do File.mkdir_p!(dest) File.cp_r!(Path.join([source, from]), dest) post_install(frontend, dest) - :ok end defp http_client do diff --git a/test/tasks/frontend_test.exs b/test/tasks/frontend_test.exs index c544bf220..50aea2e75 100644 --- a/test/tasks/frontend_test.exs +++ b/test/tasks/frontend_test.exs @@ -71,7 +71,11 @@ defmodule Mix.Tasks.Pleroma.FrontendTest do end end - describe "Installation from web, pre-built packages" do + describe "Installation from web source" do + setup do + Pleroma.Utils.command_required!("yarn") + end + test "develop" do Mix.Tasks.Pleroma.Frontend.run([ "install", -- cgit v1.2.3