Allow extra options to be passed to Muontrap via app env
parent
bc668b5ccd
commit
a5b03a6f3b
|
@ -21,6 +21,9 @@ defmodule Farmbot.FarmwareRuntime do
|
||||||
runtime_dir: "/tmp/farmware_runtime"
|
runtime_dir: "/tmp/farmware_runtime"
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
@muontrap_opts Application.get_env(:farmbot_core, __MODULE__)[:muontrap_opts]
|
||||||
|
@muontrap_opts || []
|
||||||
|
|
||||||
@packet_header_token 0xFBFB
|
@packet_header_token 0xFBFB
|
||||||
@packet_header_byte_size 10
|
@packet_header_byte_size 10
|
||||||
|
|
||||||
|
@ -124,11 +127,12 @@ defmodule Farmbot.FarmwareRuntime do
|
||||||
exec = System.find_executable(manifest.executable)
|
exec = System.find_executable(manifest.executable)
|
||||||
installation_path = install_dir(manifest)
|
installation_path = install_dir(manifest)
|
||||||
|
|
||||||
opts = [
|
opts =
|
||||||
env: env,
|
Keyword.merge(@muontrap_opts,
|
||||||
cd: installation_path,
|
env: env,
|
||||||
into: IO.stream(:stdio, :line)
|
cd: installation_path,
|
||||||
]
|
into: IO.stream(:stdio, :line)
|
||||||
|
)
|
||||||
|
|
||||||
# Start the plugin.
|
# Start the plugin.
|
||||||
{cmd, _} = spawn_monitor(MuonTrap, :cmd, [exec, manifest.args, opts])
|
{cmd, _} = spawn_monitor(MuonTrap, :cmd, [exec, manifest.args, opts])
|
||||||
|
|
Loading…
Reference in New Issue