safe_cmd_download (rebar_safe v1.0.1)

View Source

Summary

Functions

Ensure a SAFE binary is available, downloading if needed.

Read the locked version from safe.lock file if it exists.

Write the resolved version to safe.lock file.

Functions

ensure_binary_available(Dir, Debug)

-spec ensure_binary_available(string(), boolean()) -> ok | {error, term()}.

Ensure a SAFE binary is available, downloading if needed.

handle(State, Dir, Debug)

-spec handle(safe_rebar_interface:state(), string(), boolean()) ->
                {ok, safe_rebar_interface:state()} | {error, string()}.

read_lock_file(Dir)

-spec read_lock_file(string()) -> {ok, binary()} | {error, not_found | invalid_format}.

Read the locked version from safe.lock file if it exists.

write_lock_file(Dir, Version)

-spec write_lock_file(string(), binary()) -> ok | {error, term()}.

Write the resolved version to safe.lock file.