diff --git a/Makefile b/Makefile index dd4d835..2800e13 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,11 @@ deps: doc: @mkdir -p doc @$(ERL) -noshell -run edoc_run application '$(APP)' '"."' '[{preprocess, true},{includes, ["."]}, {dir, "./doc"}]' - -clean: + +clean: @./rebar clean - @rm -f couchapp + @rm -f erlca distclean: clean @./rebar delete-deps diff --git a/bootstrap b/bootstrap index 2374e28..84b91ae 100755 --- a/bootstrap +++ b/bootstrap @@ -3,14 +3,14 @@ %% ex: ft=erlang ts=4 sw=4 et main(Args) -> - + %% Add ebin/ to our path true = code:add_path("ebin"), true = code:add_path("deps/ejson/ebin"), true = code:add_path("deps/ibrowse/ebin"), true = code:add_path("deps/oauth/ebin"), true = code:add_path("deps/couchbeam/ebin"), - + %% Run couchapp to do proper .app validation and such @@ -20,9 +20,9 @@ main(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") + Files = load_files("*", "ebin") ++ load_files("*", "deps/ejson/ebin") - ++ load_files("*", "deps/ejson/priv") + ++ load_files("*", "deps/ejson/priv") ++ load_files("*", "deps/ibrowse/ebin") ++ load_files("*", "deps/oauth/ebin") ++ load_files("*", "deps/couchbeam/ebin") @@ -33,29 +33,29 @@ main(Args) -> %% Archive was successfully created. Prefix that binary with our %% header and write to "rebar" file 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; {error, WriteError} -> - io:format("Failed to write couchapp script: ~p\n", [WriteError]), + io:format("Failed to write erlca script: ~p\n", [WriteError]), halt(1) end; {error, ZipError} -> - io:format("Failed to construct couchapp archive: ~p\n", [ZipError]), + io:format("Failed to construct erlca archive: ~p\n", [ZipError]), halt(1) end, %% Finally, update executable perms for our script case os:type() of {unix,_} -> - [] = os:cmd("chmod u+x couchapp"), + [] = os:cmd("chmod u+x erlca"), ok; _ -> ok end, - + %% 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" "and you can use build and push your design docs and docs like couchapp.\n"). diff --git a/couchapp b/couchapp deleted file mode 100755 index b5cbb52..0000000 Binary files a/couchapp and /dev/null differ diff --git a/src/couchapp.erl b/src/erlca.erl similarity index 80% rename from src/couchapp.erl rename to src/erlca.erl index a3ef73b..146e463 100644 --- a/src/couchapp.erl +++ b/src/erlca.erl @@ -3,7 +3,7 @@ %%% This file is part of couchapp released under the Apache 2 license. %%% See the NOTICE for more information. --module(couchapp). +-module(erlca). -author('BenoƮt Chesneau '). -export([main/1]). @@ -15,6 +15,6 @@ main(Args) -> {error, failed} -> halt(1); Error -> - io:format("Uncaught error in couchapp_core: ~p\n", [Error]), + io:format("Uncaught error in erlca: ~p\n", [Error]), halt(1) end.