Namdak Tonpa 10 years ago
parent
commit
875ddb7187
4 changed files with 4 additions and 1 deletions
  1. 1 0
      Makefile
  2. 1 0
      include/mad.hrl
  3. BIN
      mad
  4. 2 1
      src/mad.erl

+ 1 - 0
Makefile

@@ -1,4 +1,5 @@
 default: escript
 escript:
+	echo "-define(VERSION,\"`git rev-parse HEAD | head -c 6`\")." > include/mad.hrl
 	./mad dep com bun mad
 .PHONY: escript

+ 1 - 0
include/mad.hrl

@@ -0,0 +1 @@
+-define(VERSION,"9fc629").

BIN
mad


+ 2 - 1
src/mad.erl

@@ -1,5 +1,6 @@
 -module(mad).
 -copyright('Maxim Sokhatsky').
+-include("mad.hrl").
 -compile(export_all).
 -export([main/1]).
 
@@ -100,7 +101,7 @@ static(_Cwd,_ConfigFileName,Config,Params) ->
     io:format("Compile Static Params: ~p~n",[Params]),
     mad_static:main(Config, Params).
 
-version() -> "master".
+version() -> ?VERSION.
 help(Reason, Data) -> help(io_lib:format("~s ~p", [Reason, Data])).
 help(Msg) -> io:format("Error: ~s~n~n", [Msg]), help().
 help() ->