diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-27 15:45:50 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-27 15:45:50 +0200 |
commit | a53fc2d8f586de1561b7f257e1857388d1fdfbbf (patch) | |
tree | e99bf605dc4a72efd995cb884aa1ac2ffb8ee385 | |
parent | 15b7798e46e8d4f709d1a37b93adfc073e167d73 (diff) |
Document git vsn cmd and fix formatting
-rw-r--r-- | src/rebar_app_utils.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl index 7cdf00c..5bcba44 100644 --- a/src/rebar_app_utils.erl +++ b/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"; |