Skip to main content

write_package_setting

Function write_package_setting 

Source
pub fn write_package_setting(
    path: &Path,
    package_name: &str,
) -> Result<(), RippyError>
Expand description

Write package = "<name>" to a TOML config file.

If the file has an existing package = line, it is replaced. If the file has a [settings] section but no package, the line is inserted. Otherwise, [settings]\npackage = "<name>" is prepended.

§Errors

Returns RippyError::Setup if the file cannot be read or written.