Sha256: ce2297442eb9c72641541b471225802c13706ae5966aaa032762ee1802091bae

Contents?: true

Size: 739 Bytes

Versions: 66

Compression:

Stored size: 739 Bytes

Contents

-module(rebar_lock_json).

-export([main/1]).

main([LockPath|_]) ->
    Deps = rebar_config:consult_lock_file(LockPath),
    Ejson = lists:map(fun dep_to_ejson/1, Deps),
    io:format("~s~n", [jsone:encode({Ejson})]).

dep_to_ejson({Name, {pkg, PkgName, PkgVersion, Hash}, Lvl}) ->
    {Name, {[{<<"type">>, <<"pkg">>},
             {<<"level">>, Lvl},
             {<<"pkg_name">>, PkgName},
             {<<"pkg_version">>, PkgVersion},
             {<<"pkg_hash">>, Hash}]}};
dep_to_ejson({Name, {git, GitUrl, {ref, GitRef}}, Lvl}) ->
    {Name, {[{<<"type">>, <<"git">>},
             {<<"level">>, Lvl},
             {<<"git_url">>, erlang:iolist_to_binary(GitUrl)},
             {<<"git_ref">>, erlang:iolist_to_binary(GitRef)}]}}.

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
license_scout-1.3.17 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.16 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.15 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.14 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.11 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.10 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.9 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.8 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.7 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.6 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.5 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.4 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.3 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.2 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.1 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.3.0 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.2.16 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.2.15 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.2.14 erl_src/rebar_lock_json/src/rebar_lock_json.erl
license_scout-1.2.13 erl_src/rebar_lock_json/src/rebar_lock_json.erl