63 lines
2.2 KiB
Diff
63 lines
2.2 KiB
Diff
From 0b38555707bd90d102b538a0055925a7493c74d5 Mon Sep 17 00:00:00 2001
|
|
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
Date: Tue, 28 Sep 2010 23:04:36 +0400
|
|
Subject: [PATCH 1/3] No need to create bundle
|
|
|
|
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
---
|
|
bootstrap | 38 +-------------------------------------
|
|
1 files changed, 1 insertions(+), 37 deletions(-)
|
|
|
|
diff --git a/bootstrap b/bootstrap
|
|
index 5be3183..634e1f6 100755
|
|
--- a/bootstrap
|
|
+++ b/bootstrap
|
|
@@ -51,43 +51,7 @@ main(Args) ->
|
|
true = code:add_path("ebin"),
|
|
|
|
%% Run rebar to do proper .app validation and such
|
|
- rebar:main(["compile"] ++ Args),
|
|
-
|
|
- %% Read the contents of the files in ebin and templates; note that we place
|
|
- %% all the beam files at the top level of the code archive so that code loading
|
|
- %% works properly.
|
|
- Files = load_files("*", "ebin") ++ load_files("priv/templates/*", "."),
|
|
-
|
|
- case zip:create("mem", Files, [memory]) of
|
|
- {ok, {"mem", ZipBin}} ->
|
|
- %% Archive was successfully created. Prefix that binary with our
|
|
- %% header and write to "rebar" file
|
|
- Script = <<"#!/usr/bin/env escript\n%%! -noshell -noinput\n", ZipBin/binary>>,
|
|
- case file:write_file("rebar", Script) of
|
|
- ok ->
|
|
- ok;
|
|
- {error, WriteError} ->
|
|
- io:format("Failed to write rebar script: ~p\n", [WriteError]),
|
|
- halt(1)
|
|
- end;
|
|
- {error, ZipError} ->
|
|
- io:format("Failed to construct rebar script archive: ~p\n", [ZipError]),
|
|
- halt(1)
|
|
- end,
|
|
-
|
|
- %% Finally, update executable perms for our script
|
|
- case os:type() of
|
|
- {unix,_} ->
|
|
- [] = os:cmd("chmod u+x rebar"),
|
|
- ok;
|
|
- _ ->
|
|
- ok
|
|
- end,
|
|
-
|
|
- %% Add a helpful message
|
|
- io:format("Congratulations! You now have a self-contained script called \"rebar\" in\n"
|
|
- "your current working directory. Place this script anywhere in your path\n"
|
|
- "and you can use rebar to build OTP-compliant apps.\n").
|
|
+ rebar:main(["compile"] ++ Args).
|
|
|
|
rm(Path) ->
|
|
NativePath = filename:nativename(Path),
|
|
--
|
|
1.7.2.3
|
|
|