Skip to content

Commit

Permalink
Merge pull request #25 from emqx/improve-build
Browse files Browse the repository at this point in the history
chore: fail with more readable error if fdb is not installed
  • Loading branch information
zmstone authored Sep 1, 2024
2 parents f87cd7d + c9a3fd7 commit 8b6477f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
MaxAPIVersion =
begin
VsnInfo = os:cmd("fdbcli --version"),
{match, [ProtocolStr]} = re:run(VsnInfo, "protocol ([a-f0-9]*)", [{capture, [1], list}]),
ProtocolVsn = list_to_integer(ProtocolStr, 16),
APIVersionBytes = (ProtocolVsn band 16#0000000FFF00000) bsr 20,
integer_to_list(APIVersionBytes, 16)
case re:run(VsnInfo, "protocol ([a-f0-9]*)", [{capture, [1], list}]) of
{match, [ProtocolStr]} ->
ProtocolVsn = list_to_integer(ProtocolStr, 16),
APIVersionBytes = (ProtocolVsn band 16#0000000FFF00000) bsr 20,
integer_to_list(APIVersionBytes, 16);
_ ->
io:format(user, "fdbcli is not installed~n", []),
halt(1)
end
end.

% https://github.com/markusn/coveralls-erl#example-usage-rebar3-and-github-actions
Expand Down

0 comments on commit 8b6477f

Please sign in to comment.