use std::path::Path;
use diskit::{diskit_extend::DiskitExt, open_options::OpenOptions, Diskit};
use crate::Error;
#[allow(clippy::needless_pass_by_value)]
pub fn ensure_file_existence<D>(home: &Path, diskit: D) -> Result<(), Error>
where
D: Diskit,
{
let base = home.join(".zvavybir/legacylisten");
diskit.create_dir_all(&base)?;
diskit.open_with_options(
&base.join("conffile.csv"),
OpenOptions::new().write(true).create(true),
)?;
diskit.open_with_options(
&base.join("songs.csv"),
OpenOptions::new().write(true).create(true),
)?;
Ok(())
}