From a2c63d0aa5b8e7372ada2fa057c65568bfb6cf8b Mon Sep 17 00:00:00 2001 From: Matthew Sackman Date: Fri, 30 Oct 2009 12:02:51 +0000 Subject: Added destination file, and lifted the code from rabbit_misc:write_term_file (though with ~p, not ~w) --- generate_app | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'generate_app') diff --git a/generate_app b/generate_app index 62301292..5c15358a 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}])). -- cgit v1.2.1 From 83fd08618c28eefc74e5cb386e3d9c4e2c1672e2 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Wed, 4 Nov 2009 16:08:13 +0000 Subject: cosmetic --- generate_app | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'generate_app') diff --git a/generate_app b/generate_app index 5c15358a..576b485e 100644 --- a/generate_app +++ b/generate_app @@ -7,6 +7,6 @@ main([BeamDir, TargetFile]) -> {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}])). + file:write_file( + TargetFile, + io_lib:format("~p.~n", [{application, Application, NewProperties}])). -- cgit v1.2.1