Closed oubiwann closed 1 month ago
There are many ways to support a workflow like this, but there's one solution that intrigues me most:
Right, I forgot: when using rebar, erl and lfe are not called; rather, the shells are invoked in code, so there is not passing of args directly to either. Will have to explore the ENV route ...
Well, I guess we don't have to use the ENV route, since we do have rebar3 lfe run
...
Okay, I've created a main
script in priv/scripts/playlist-add.lfe
that takes kv pairs as args on the CLI and turns them into a map.
rebar.config
profile section:
{profiles, [
...
{'playlist-add', [
{lfe, [{main, "priv/scripts/playlist-add.lfe"}]}
]}
]}.
Using this profile:
rebar3 as playlist-add lfe run -- name seq1 file priv/seqs/basic.lfe
Output of the script after a couple of rpc ~calls~ casts:
Playlist state: #M(opts #M(repeat f)
queue
(#M(name "seq1" file "priv/seqs/basic.lfe")
#M(name "seq1" file "priv/seqs/basic.lfe"))
played ())
That's basic infrastructure experiments done; next is the hard part of determining the best short-term solution for actually playing these files (a longer term solution can't be worked on until this epic work is nearing completion).
Key required behaviours:
Phew! That's the most involved OTP I've done in a while ...
Upon demand from an external source ...
Target workflow:
Dev tasks:
timer:sleep
-- -<flag> file
)