Skip to content

Commit

Permalink
Example
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Nov 15, 2024
1 parent a6bc894 commit 2404e1f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scriptify
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env escript

-define(SHEBANG, "/usr/bin/env escript").
-define(COMMENT, "").
-define(EMU_ARGS, "-noinput +B -sasl errlog_type error -escript main ").

main([Name | Beams]) ->
BeamData = [{filename:basename(B), read(B)}|| B <- Beams],
ok = escript:create(Name, [{archive, BeamData, [memory]},
{shebang, ?SHEBANG},
{comment, ?COMMENT},
{emu_args, ?EMU_ARGS ++ Name}]),
ok = file:change_mode(Name, 8#755).
read(File) ->
{ok, B} = file:read_file(filename:absname(File)),
B.

0 comments on commit 2404e1f

Please sign in to comment.