Skip to content

Commit

Permalink
cover2json
Browse files Browse the repository at this point in the history
  • Loading branch information
shortishly committed Jul 23, 2023
1 parent 5373991 commit c633f1a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ runs:
with:
otp-version: ${{inputs.otp-version}}
- run: |
make -C $GITHUB_ACTION_PATH escript
make -C $GITHUB_ACTION_PATH app
shell: bash
- run: |
$GITHUB_ACTION_PATH/coverdata --input ${{inputs.input}} --output ${{inputs.output}}
$GITHUB_ACTION_PATH/cover2json --input ${{inputs.input}} --output ${{inputs.output}}
shell: bash
39 changes: 39 additions & 0 deletions cover2json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env escript -c
%% -*- erlang -*-
%% Copyright (c) 2023 Peter Morgan <peter.james.morgan@gmail.com>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%


-module(cover2json).


main(Args) ->
RootDir = escript_directory(),
true = code:add_path(filename:join(RootDir, "ebin")),
lists:foreach(
fun
(Dependency) ->
true = code:add_path(
filename:join([RootDir, "deps", Dependency, "ebin"]))
end,
begin
{ok, Dependencies} = file:list_dir(filename:join(RootDir, "deps")),
Dependencies
end),
coverdata:main(Args).

escript_directory() ->
Components = filename:split(escript:script_name()),
filename:join(lists:sublist(Components, length(Components) - 1)).

0 comments on commit c633f1a

Please sign in to comment.