diff options
Diffstat (limited to 'rola-bucket/src/bucket/init.rs')
| -rw-r--r-- | rola-bucket/src/bucket/init.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/rola-bucket/src/bucket/init.rs b/rola-bucket/src/bucket/init.rs index 6834009..d2dda24 100644 --- a/rola-bucket/src/bucket/init.rs +++ b/rola-bucket/src/bucket/init.rs @@ -12,6 +12,8 @@ use shared_constants::{ }; use space_system::SpaceError; +use crate::config::{BucketConfig, write_bucket_config_to_path}; + pub(crate) fn init_bucket_at(path: PathBuf) -> Result<(), SpaceError> { let bucket_config_file = path.join(FILE_BUCKET_ROOT_CONFIG); @@ -21,16 +23,12 @@ pub(crate) fn init_bucket_at(path: PathBuf) -> Result<(), SpaceError> { return Err(SpaceError::RequireEmptyDirectory); } - write_config(&bucket_config_file)?; + write_bucket_config_to_path(&bucket_config_file, &BucketConfig::default())?; create_dirs(&path)?; Ok(()) } -fn write_config(bucket_config_file: &Path) -> Result<(), SpaceError> { - fs::write(bucket_config_file, include_str!("../../res/bucket.toml")).map_err(SpaceError::Io) -} - fn create_dirs(bucket_dir: &Path) -> Result<(), SpaceError> { let dirs = [ DIR_BUCKET_OBJ, |
