浏览代码

Document git vsn cmd and fix formatting

pull/3/head
Tuncer Ayaz 14 年前
父节点
当前提交
a53fc2d8f5
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. +7
    -3
      src/rebar_app_utils.erl

+ 7
- 3
src/rebar_app_utils.erl 查看文件

@ -152,9 +152,11 @@ vcs_vsn(Vcs, Dir) ->
%% tree structure, there may be one higher up, but that can
%% yield unexpected results when used with deps. So, we
%% fallback to searching for a priv/vsn.Vcs file.
case file:read_file(filename:join([Dir, "priv", "vsn" ++ Extension])) of
VsnFile = filename:join([Dir, "priv", "vsn" ++ Extension]),
case file:read_file(VsnFile) of
{ok, VsnBin} ->
?DEBUG("vcs_vsn: Read ~s from priv/vsn.~p\n", [VsnBin, Vcs]),
?DEBUG("vcs_vsn: Read ~s from priv/vsn.~p\n",
[VsnBin, Vcs]),
string:strip(binary_to_list(VsnBin), right, $\n);
{error, enoent} ->
?DEBUG("vcs_vsn: Fallback to vcs for ~s\n", [Dir]),
@ -163,7 +165,9 @@ vcs_vsn(Vcs, Dir) ->
end
end.
vcs_vsn_cmd(git) -> "git describe --always --tags `git log -n 1 --pretty=format:%h .`";
vcs_vsn_cmd(git) ->
%% git describe a committish to accomodate for subtrees or deps/apps
"git describe --always --tags `git log -n 1 --pretty=format:%h .`";
vcs_vsn_cmd(hg) -> "hg identify -i";
vcs_vsn_cmd(bzr) -> "bzr revno";
vcs_vsn_cmd(svn) -> "svnversion";

正在加载...
取消
保存