pub fn parse_happ(happ: Option<PathBuf>) -> anyhow::Result<PathBuf> {
    let mut happ = happ.unwrap_or(std::env::current_dir()?);
    if happ.is_dir() {
        let file_path = search_for_happ(&happ)?;
        happ = file_path;
    }
    ensure!(
        happ.file_name()
            .map(|f| f.to_string_lossy().ends_with(".happ"))
            .unwrap_or(false),
        "File {} is not a valid happ file name: (e.g. my-happ.happ)",
        happ.display()
    );
    Ok(happ)
}
/// Parse a happ bundle.
/// If paths are directories then each directory
/// will be searched for the first file that matches
/// `*.saf`.
Parse a happ bundle.
If paths are directories then each directory
will be searched for the first file that matches
`*.saf`.
Parse a happ bundle . If paths are directories then each directory will be searched for the first file that matches ` * . saf ` .
pub fn parse_happ(happ: Option<PathBuf>) -> anyhow::Result<PathBuf> {
    let mut happ = happ.unwrap_or(std::env::current_dir()?);
    if happ.is_dir() {
        let file_path = search_for_happ(&happ)?;
        happ = file_path;
    }
    ensure!(
        happ.file_name()
            .map(|f| f.to_string_lossy().ends_with(".happ"))
            .unwrap_or(false),
        "File {} is not a valid happ file name: (e.g. my-happ.happ)",
        happ.display()
    );
    Ok(happ)
}
pub fn parse_happ ( happ : Option < PathBuf > ) -> anyhow :: Result < PathBuf > { let mut happ = happ . unwrap_or ( std :: env :: current_dir ( ) ? ) ; if happ . is_dir ( ) { let file_path = search_for_happ ( & happ ) ? ; happ = file_path ; } ensure ! ( happ file_name ( ) map ( f f to_string_lossy ( ) ends_with ( " " ) ) unwrap_or ( false ) " " happ display ( ) ) ; Ok ( happ ) }
Parse a happ bundle.
Parse a happ bundle .
happ
Option<PathBuf>
happ
Option<PathBuf>