Function brane_cli::utils::ensure_packages_dir

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

Makes sure that Brane’s packages directory exists, and then returns its path.
Basically, tries to resolve the folder ’~/.local/share/brane/packages`.

Arguments

  • create: If set to true, creates the missing file and directories instead of throwing errors.

Returns
A PathBuf with the absolute path that is guaranteed to exist, or an UtilError otherwise.