Made grep version command's grep POSIX

This commit is contained in:
Joe DeVivo 2015-07-12 07:31:08 -07:00
parent e56c73c940
commit 381189c006
2 changed files with 19 additions and 1 deletions

View file

@ -86,7 +86,10 @@ get_patch_count(RawRef) ->
-spec parse_tags(t()) -> {string()|undefined, ec_semver:version_string()}.
parse_tags({Prefix}) ->
first_valid_tag(os:cmd("git log --oneline --decorate | fgrep \"tag: \" -1000"), Prefix).
first_valid_tag(os:cmd("git log --oneline --decorate | grep -F \"tag: \""), Prefix).
%% TODO: The following command sould be able to get the version
%% number directly, without a re:run. Should be checked for POSIX
%% "git log --oneline --decorate | grep -F \"tag: \" --color=never | head -n 1 | sed \"s/.*tag: " ++ Prefix ++ "\([^,)]*\).*/\1/\"".
-spec first_valid_tag(string(), string()) -> {string()|undefined, ec_semver:version_string()}.
first_valid_tag(Line, Prefix) ->