Skip to content
This repository
Browse code

Reformat bootstrap

  • Loading branch information...
commit 461335acf91950538d2e897a359201f257967ec5 1 parent 92129d6
Tuncer Ayaz authored August 16, 2011

Showing 1 changed file with 20 additions and 13 deletions. Show diff stats Hide diff stats

  1. 33  bootstrap
33  bootstrap
@@ -25,10 +25,11 @@ main(Args) ->
25 25
                 end,
26 26
 
27 27
     %% Compile all src/*.erl to ebin
28  
-    case make:files(filelib:wildcard("src/*.erl"), [{outdir, "ebin"}, {i, "include"},
29  
-                                                    DebugFlag,
30  
-                                                    {d, 'BUILD_TIME', Built},
31  
-                                                    {d, 'VCS_INFO', VcsInfo}]) of
  28
+    case make:files(filelib:wildcard("src/*.erl"),
  29
+                    [{outdir, "ebin"}, {i, "include"},
  30
+                     DebugFlag,
  31
+                     {d, 'BUILD_TIME', Built},
  32
+                     {d, 'VCS_INFO', VcsInfo}]) of
32 33
         up_to_date ->
33 34
             ok;
34 35
         error ->
@@ -51,9 +52,9 @@ main(Args) ->
51 52
     %% Run rebar to do proper .app validation and such
52 53
     rebar:main(["compile"] ++ Args),
53 54
 
54  
-    %% Read the contents of the files in ebin and templates; note that we place
55  
-    %% all the beam files at the top level of the code archive so that code loading
56  
-    %% works properly.
  55
+    %% Read the contents of the files in ebin and templates; note that we
  56
+    %% place all the beam files at the top level of the code archive so
  57
+    %% that code loading works properly.
57 58
     Files = load_files("*", "ebin") ++ load_files("priv/templates/*", "."),
58 59
 
59 60
     case zip:create("mem", Files, [memory]) of
@@ -62,16 +63,19 @@ main(Args) ->
62 63
             %% header and write to "rebar" file.
63 64
             %% Without -noshell -noinput escript consumes all input that would
64 65
             %% otherwise go to the shell for the next command.
65  
-            Script = <<"#!/usr/bin/env escript\n%%! -noshell -noinput\n", ZipBin/binary>>,
  66
+            Script = <<"#!/usr/bin/env escript\n%%! -noshell -noinput\n",
  67
+                       ZipBin/binary>>,
66 68
             case file:write_file("rebar", Script) of
67 69
                 ok ->
68 70
                     ok;
69 71
                 {error, WriteError} ->
70  
-                    io:format("Failed to write rebar script: ~p\n", [WriteError]),
  72
+                    io:format("Failed to write rebar script: ~p\n",
  73
+                              [WriteError]),
71 74
                     halt(1)
72 75
             end;
73 76
         {error, ZipError} ->
74  
-            io:format("Failed to construct rebar script archive: ~p\n", [ZipError]),
  77
+            io:format("Failed to construct rebar script archive: ~p\n",
  78
+                      [ZipError]),
75 79
             halt(1)
76 80
     end,
77 81
 
@@ -85,8 +89,10 @@ main(Args) ->
85 89
     end,
86 90
 
87 91
     %% Add a helpful message
88  
-    io:format("Congratulations! You now have a self-contained script called \"rebar\" in\n"
89  
-              "your current working directory. Place this script anywhere in your path\n"
  92
+    io:format("Congratulations! You now have a self-contained script called"
  93
+              " \"rebar\" in\n"
  94
+              "your current working directory. "
  95
+              "Place this script anywhere in your path\n"
90 96
               "and you can use rebar to build OTP-compliant apps.\n").
91 97
 
92 98
 rm(Path) ->
@@ -100,7 +106,8 @@ rm(Path) ->
100 106
 
101 107
 build_time() ->
102 108
     {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(now()),
103  
-    lists:flatten(io_lib:format("~4..0w~2..0w~2..0w_~2..0w~2..0w~2..0w", [Y, M, D, H, Min, S])).
  109
+    lists:flatten(io_lib:format("~4..0w~2..0w~2..0w_~2..0w~2..0w~2..0w",
  110
+                                [Y, M, D, H, Min, S])).
104 111
 
105 112
 
106 113
 load_files(Wildcard, Dir) ->

0 notes on commit 461335a

Please sign in to comment.
Something went wrong with that request. Please try again.