I’m using .beam as script file, then I can hidden my code and run every where.
Usually, there are multiple files work together like:
main.erl
util.erl
....
Is it possible to merge multiple beam files into one beam?
What I can think of is to hardcode the beam into an erl file and then compile it, like
["[",
lists:map(fun(Beam) ->
{ok, Bin} = prim_file:read_file(Beam),
["{", filename:basename(Beam, ".beam"), ",", io_lib:format("~w", [Bin]), "},"]
end, BeamList)
"ok]"]
get
[{module, <<"....">>}]
finally, use code:load_file to load it