pub fn initialize(
config: &Config,
dir: &Option<String>,
) -> Result<(), PathError>
Expand description
Initialize the timelog directory supplied and create a .timelogrc
config file.
If no directory is supplied default to ~/timelog
§Errors
- Return
PathError::CantCreatePath
if cannot create timelog directory - Return
PathError::FileAccess
if we are unable to write the configuration. - Return
PathError::InvalidPath
if the path is not valid
§Panics
If the canonicalized path cannot be converted to a string.