pub async fn unpack<M: Manifest>(
    extension: &'static str,
    bundle_path: &std::path::Path,
    target_dir: Option<PathBuf>,
    force: bool,
) -> AinBundleResult<PathBuf> {
    let bundle_path = ffs::canonicalize(bundle_path).await?;
    let bundle: Bundle<M> = Bundle::read_from_file(&bundle_path).await?;

    let target_dir = if let Some(d) = target_dir {
        d
    } else {
        bundle_path_to_dir(&bundle_path, extension)?
    };

    bundle.unpack_yaml(&target_dir, force).await?;

    Ok(target_dir)
}
/// Unpack a SAF bundle into a working directory, returning the directory path used.
Unpack a SAF bundle into a working directory, returning the directory path used.
Unpack a SAF bundle into a working directory returning the directory path used .
pub async fn unpack<M: Manifest>(
    extension: &'static str,
    bundle_path: &std::path::Path,
    target_dir: Option<PathBuf>,
    force: bool,
) -> AinBundleResult<PathBuf> {
    let bundle_path = ffs::canonicalize(bundle_path).await?;
    let bundle: Bundle<M> = Bundle::read_from_file(&bundle_path).await?;
    let target_dir = if let Some(d) = target_dir {
        d
    } else {
        bundle_path_to_dir(&bundle_path, extension)?
    };
    bundle.unpack_yaml(&target_dir, force).await?;
    Ok(target_dir)
}
pub async fn unpack < M : Manifest > ( extension : & ' static str , bundle_path : & std :: path :: Path , target_dir : Option < PathBuf > , force : bool , ) -> AinBundleResult < PathBuf > { let bundle_path = ffs :: canonicalize ( bundle_path ) . await ? ; let bundle : Bundle < M > = Bundle :: read_from_file ( & bundle_path ) . await ? ; let target_dir = if let Some ( d ) = target_dir { d } else { bundle_path_to_dir ( & bundle_path , extension ) ? } ; bundle . unpack_yaml ( & target_dir , force ) . await ? ; Ok ( target_dir ) }
Unpack a SAF bundle into a working directory, returning the directory path used.
Unpack a SAF bundle into a working directory returning the directory path used .
extension
&'static str
bundle_path
&std::path::Path
target_dir
Option<PathBuf>
force
bool
extension
&'static str
bundle_path
&std::path::Path
target_dir
Option<PathBuf>
force
bool