fix(plugins): create directory before uploading
Fixes https://emqx.atlassian.net/browse/EMQX-9434 Fixes https://github.com/emqx/emqx-elixir-plugin/issues/23
This commit is contained in:
parent
36043dd651
commit
a2b82dae69
|
@ -428,6 +428,7 @@ update_boot_order(post, #{bindings := #{name := Name}, body := Body}) ->
|
|||
%% For RPC upload_install/2
|
||||
install_package(FileName, Bin) ->
|
||||
File = filename:join(emqx_plugins:install_dir(), FileName),
|
||||
ok = filelib:ensure_dir(File),
|
||||
ok = file:write_file(File, Bin),
|
||||
PackageName = string:trim(FileName, trailing, ".tar.gz"),
|
||||
case emqx_plugins:ensure_installed(PackageName) of
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fixed an issue where a build made with Elixir could not receive uploaded plugins until the `plugins` folder was created manually to receive the uploaded files.
|
3
mix.exs
3
mix.exs
|
@ -394,10 +394,12 @@ defmodule EMQXUmbrella.MixProject do
|
|||
bin = Path.join(release.path, "bin")
|
||||
etc = Path.join(release.path, "etc")
|
||||
log = Path.join(release.path, "log")
|
||||
plugins = Path.join(release.path, "plugins")
|
||||
|
||||
Mix.Generator.create_directory(bin)
|
||||
Mix.Generator.create_directory(etc)
|
||||
Mix.Generator.create_directory(log)
|
||||
Mix.Generator.create_directory(plugins)
|
||||
Mix.Generator.create_directory(Path.join(etc, "certs"))
|
||||
|
||||
Enum.each(
|
||||
|
@ -610,6 +612,7 @@ defmodule EMQXUmbrella.MixProject do
|
|||
&[
|
||||
"etc",
|
||||
"data",
|
||||
"plugins",
|
||||
"bin/node_dump"
|
||||
| &1
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue