From ffa0cda467ce851ff57aa23b92ab8f3fd679fb33 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Mon, 7 Dec 2009 16:03:56 -0700 Subject: Updating bootstrap to embed the build time into a macro that we can pull via "version" command --- src/rebar_core.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 7a40200..d39a425 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -28,11 +28,22 @@ -include("rebar.hrl"). +-ifndef(BUILD_TIME). +-define(BUILD_TIME, "undefined"). +-endif. + %% =================================================================== %% Public API %% =================================================================== -run(Args) -> +run(["version"]) -> + %% Load application spec and display vsn and build time info + ok = application:load(rebar), + {ok, Vsn} = application:get_key(rebar, vsn), + ?CONSOLE("Version ~s built ~s\n", [Vsn, ?BUILD_TIME]), + ok; +run(Args) -> + ?CONSOLE("Args: ~p\n", [Args]), %% Filter all the flags (i.e. string of form key=value) from the %% command line arguments. What's left will be the commands to run. Commands = filter_flags(Args, []), -- cgit v1.1