Fix frontend install mix task bug

This commit is contained in:
Sean King 2020-09-01 12:20:32 -06:00
parent d48755791d
commit 0a9c63fb43
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,7 @@ def run(["install", frontend | args]) do
fe_label = "#{frontend} (#{ref})" fe_label = "#{frontend} (#{ref})"
tmp_dir = Path.join(dest, "tmp") tmp_dir = Path.join([instance_static_dir, "frontends", "tmp"])
with {_, :ok} <- with {_, :ok} <-
{:download_or_unzip, download_or_unzip(frontend_info, tmp_dir, options[:file])}, {:download_or_unzip, download_or_unzip(frontend_info, tmp_dir, options[:file])},
@ -133,6 +133,7 @@ defp download_build(frontend_info, dest) do
defp install_frontend(frontend_info, source, dest) do defp install_frontend(frontend_info, source, dest) do
from = frontend_info["build_dir"] || "dist" from = frontend_info["build_dir"] || "dist"
File.rm_rf!(dest)
File.mkdir_p!(dest) File.mkdir_p!(dest)
File.cp_r!(Path.join([source, from]), dest) File.cp_r!(Path.join([source, from]), dest)
:ok :ok