Skip to content

Commit

Permalink
chore: fail with more readable error if fdb is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
zmstone committed Aug 31, 2024
1 parent f87cd7d commit c9a3fd7
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 c9a3fd7

Please sign in to comment.