Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fail with more readable error if fdb is not installed #25

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading