/// Find and load all manifests from the current directory, sorted in
/// priority order.
Find and load all manifests from the current directory, sorted in
priority order.
Find and load all manifests from the current directory sorted in priority order .
pub fn discover(mut current_dir: &Path) -> anyhow::Result<Vec<Manifest>> {
        let mut manifests = Vec::new();
        // Starting in the current directory, find every manifest file,
        // prioritizing manifests that are closer to our current dir.
        loop {
            if let Some(manifest) = Self::load_from_dir(current_dir)? {
                manifests.push(manifest);
            }
            match current_dir.parent() {
                Some(parent) => current_dir = parent,
                None => break,
            }
        }
        // We'll also load the user's global config, usually from
        // ~/.aftman/aftman.toml.
        let global_dir = config_dir()?;
        if let Some(manifest) = Self::load_from_dir(&global_dir)? {
            manifests.push(manifest);
        }
        Ok(manifests)
    }
pub fn discover ( mut current_dir : & Path ) -> anyhow :: Result < Vec < Manifest > > { let mut manifests = Vec :: new ( ) ; // Starting in the current directory, find every manifest file, // prioritizing manifests that are closer to our current dir. loop { if let Some ( manifest ) = Self :: load_from_dir ( current_dir ) ? { manifests . push ( manifest ) ; } match current_dir . parent ( ) { Some ( parent ) => current_dir = parent , None => break , } } // We'll also load the user's global config, usually from // ~/.aftman/aftman.toml. let global_dir = config_dir ( ) ? ; if let Some ( manifest ) = Self :: load_from_dir ( & global_dir ) ? { manifests . push ( manifest ) ; } Ok ( manifests ) }
Find and load all manifests from the current directory, sorted in
priority order.
Find and load all manifests from the current directory sorted in priority order .
current_dir
&Path