File: generate_app

package info (click to toggle)
rabbitmq-server 1.8.1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,284 kB
  • ctags: 2,309
  • sloc: erlang: 12,095; xml: 1,605; sh: 648; python: 630; makefile: 243
file content (12 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env escript
%% -*- erlang -*-

main([BeamDir, TargetFile]) ->
    Modules = [list_to_atom(filename:basename(F, ".beam")) ||
                  F <- filelib:wildcard("*.beam", BeamDir)],
    {ok, {application, Application, Properties}} = io:read(''),
    NewProperties = lists:keyreplace(modules, 1, Properties,
                                     {modules, Modules}),
    file:write_file(
      TargetFile,
      io_lib:format("~p.~n", [{application, Application, NewProperties}])).