Function brane_cli::utils::ensure_dataset_dir

source ·
pub fn ensure_dataset_dir<S: AsRef<str>>(
    name: S,
    create: bool,
) -> Result<PathBuf, UtilError>
Expand description

Makes sure that the dataset directory for the given dataset exists, then returns the path to it.

§Generic arguments

  • S: The &str-like name of the dataset to generate the path for.

§Arguments

  • name: The name of the dataset we want to get/create the directory for.
  • create: If set to true, creates the missing directories instead of throwing errors.

§Returns

A PathBuf with the directory.

§Errors

This function may error if we failed to get the parent datasets directory (see get_datasets_dir()) or if we failed to verify/create the dataset.