Function brane_cli::utils::ensure_instances_dir

source ·
pub fn ensure_instances_dir(create: bool) -> Result<PathBuf, UtilError>
Expand description

Gets the directory where we store instance definitions and ensures it exists.

§Arguments

  • create: If given, ensures it exists by attempting to create it. If set to false, then this function will error if it does not exist instead.

§Returns

The path to the directory where we shall/have store(d) instance definitions. You can assume the directory exists if this happens.

§Errors

This function errors if we failed to get the Brane configuration directory or if we failed to create any directory required.