summaryrefslogtreecommitdiff
path: root/generate_app
diff options
context:
space:
mode:
authorBen Hood <0x6e6562@gmail.com>2009-11-05 14:43:08 +0000
committerBen Hood <0x6e6562@gmail.com>2009-11-05 14:43:08 +0000
commit1dd1714e10a70ac0765f3062e79d23e00ade2000 (patch)
tree700eab5983fbcdde0e3807f11b9aa069233d0e73 /generate_app
parentd79eb60d0c74d3591a2b470a44eca0b09e540b2f (diff)
parent3e86a1b9881957309d432c8b2e5f295a07f8f920 (diff)
downloadrabbitmq-server-1dd1714e10a70ac0765f3062e79d23e00ade2000.tar.gz
Merged default into bug21775bug21775
Diffstat (limited to 'generate_app')
-rw-r--r--generate_app6
1 files changed, 4 insertions, 2 deletions
diff --git a/generate_app b/generate_app
index 62301292..576b485e 100644
--- a/generate_app
+++ b/generate_app
@@ -1,10 +1,12 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-main([BeamDir]) ->
+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}),
- io:format("~p.", [{application, Application, NewProperties}]).
+ file:write_file(
+ TargetFile,
+ io_lib:format("~p.~n", [{application, Application, NewProperties}])).