Skip to content

Commit

Permalink
rename output command to erlca
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale Harvey authored and benoitc committed May 28, 2011
1 parent a6a3cbc commit d5e62e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -13,11 +13,11 @@ deps:
doc: doc:
@mkdir -p doc @mkdir -p doc
@$(ERL) -noshell -run edoc_run application '$(APP)' '"."' '[{preprocess, true},{includes, ["."]}, {dir, "./doc"}]' @$(ERL) -noshell -run edoc_run application '$(APP)' '"."' '[{preprocess, true},{includes, ["."]}, {dir, "./doc"}]'



clean:
clean:
@./rebar clean @./rebar clean
@rm -f couchapp @rm -f erlca


distclean: clean distclean: clean
@./rebar delete-deps @./rebar delete-deps
Expand Down
20 changes: 10 additions & 10 deletions bootstrap
Expand Up @@ -3,14 +3,14 @@
%% ex: ft=erlang ts=4 sw=4 et %% ex: ft=erlang ts=4 sw=4 et


main(Args) -> main(Args) ->

%% Add ebin/ to our path %% Add ebin/ to our path
true = code:add_path("ebin"), true = code:add_path("ebin"),
true = code:add_path("deps/ejson/ebin"), true = code:add_path("deps/ejson/ebin"),
true = code:add_path("deps/ibrowse/ebin"), true = code:add_path("deps/ibrowse/ebin"),
true = code:add_path("deps/oauth/ebin"), true = code:add_path("deps/oauth/ebin"),
true = code:add_path("deps/couchbeam/ebin"), true = code:add_path("deps/couchbeam/ebin"),





%% Run couchapp to do proper .app validation and such %% Run couchapp to do proper .app validation and such
Expand All @@ -20,9 +20,9 @@ main(Args) ->
%% Read the contents of the files in ebin and templates; note that we place %% 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 %% all the beam files at the top level of the code archive so that code loading
%% works properly. %% works properly.
Files = load_files("*", "ebin") Files = load_files("*", "ebin")
++ load_files("*", "deps/ejson/ebin") ++ load_files("*", "deps/ejson/ebin")
++ load_files("*", "deps/ejson/priv") ++ load_files("*", "deps/ejson/priv")
++ load_files("*", "deps/ibrowse/ebin") ++ load_files("*", "deps/ibrowse/ebin")
++ load_files("*", "deps/oauth/ebin") ++ load_files("*", "deps/oauth/ebin")
++ load_files("*", "deps/couchbeam/ebin") ++ load_files("*", "deps/couchbeam/ebin")
Expand All @@ -33,29 +33,29 @@ main(Args) ->
%% Archive was successfully created. Prefix that binary with our %% Archive was successfully created. Prefix that binary with our
%% header and write to "rebar" file %% header and write to "rebar" file
Script = <<"#!/usr/bin/env escript\n%%! -pa . -noshell -noinput -sasl errlog_type error\n", ZipBin/binary>>, Script = <<"#!/usr/bin/env escript\n%%! -pa . -noshell -noinput -sasl errlog_type error\n", ZipBin/binary>>,
case file:write_file("couchapp", Script) of case file:write_file("erlca", Script) of
ok -> ok ->
ok; ok;
{error, WriteError} -> {error, WriteError} ->
io:format("Failed to write couchapp script: ~p\n", [WriteError]), io:format("Failed to write erlca script: ~p\n", [WriteError]),
halt(1) halt(1)
end; end;
{error, ZipError} -> {error, ZipError} ->
io:format("Failed to construct couchapp archive: ~p\n", [ZipError]), io:format("Failed to construct erlca archive: ~p\n", [ZipError]),
halt(1) halt(1)
end, end,


%% Finally, update executable perms for our script %% Finally, update executable perms for our script
case os:type() of case os:type() of
{unix,_} -> {unix,_} ->
[] = os:cmd("chmod u+x couchapp"), [] = os:cmd("chmod u+x erlca"),
ok; ok;
_ -> _ ->
ok ok
end, end,

%% Add a helpful message %% Add a helpful message
io:format("Congratulations! You now have a self-contained script called \"couchapp\" in\n" io:format("Congratulations! You now have a self-contained script called \"erlca\" in\n"
"your current working directory. Place this script anywhere in your path\n" "your current working directory. Place this script anywhere in your path\n"
"and you can use build and push your design docs and docs "and you can use build and push your design docs and docs
like couchapp.\n"). like couchapp.\n").
Expand Down
Binary file removed couchapp
Binary file not shown.
4 changes: 2 additions & 2 deletions src/couchapp.erl → src/erlca.erl
Expand Up @@ -3,7 +3,7 @@
%%% This file is part of couchapp released under the Apache 2 license. %%% This file is part of couchapp released under the Apache 2 license.
%%% See the NOTICE for more information. %%% See the NOTICE for more information.


-module(couchapp). -module(erlca).
-author('Benoît Chesneau <benoitc@e-engura.org>'). -author('Benoît Chesneau <benoitc@e-engura.org>').


-export([main/1]). -export([main/1]).
Expand All @@ -15,6 +15,6 @@ main(Args) ->
{error, failed} -> {error, failed} ->
halt(1); halt(1);
Error -> Error ->
io:format("Uncaught error in couchapp_core: ~p\n", [Error]), io:format("Uncaught error in erlca: ~p\n", [Error]),
halt(1) halt(1)
end. end.

0 comments on commit d5e62e9

Please sign in to comment.