safe_config (rebar_safe v1.0.1)

View Source

Summary

Functions

Interactively write pre-encoded Config (iodata) to File. If File exists, the user is prompted whether to overwrite. Returns ok on success or if the user declines, {error, Reason} on failure.

Build the SAFE configuration map from rebar3 project state.

Ensure parent directory exists and write ConfigMap as pretty JSON to FilePath.

Functions

interactive_write(File, Config)

Interactively write pre-encoded Config (iodata) to File. If File exists, the user is prompted whether to overwrite. Returns ok on success or if the user declines, {error, Reason} on failure.

make_config(State)

-spec make_config(safe_rebar_interface:state()) -> {ok, map()} | {error, term()}.

Build the SAFE configuration map from rebar3 project state.

save(FilePath, ConfigMap)

-spec save(file:filename_all(), map()) -> ok | {error, {config_write_error, term()}}.

Ensure parent directory exists and write ConfigMap as pretty JSON to FilePath.