fn build_plugin(dir: &Path) -> Result<PathBuf, Error> {
    {
        let mut cmd = Command::new("cargo");
        cmd.current_dir(dir);
        cmd.arg("build").stderr(Stdio::inherit());
        cmd.output()?;
    }

    for entry in fs::read_dir(&dir.join("target").join("debug"))? {
        let entry = entry?;

        let s = entry.file_name().to_string_lossy().into_owned();
        if (s.starts_with("libswc_internal") && (s.ends_with(".so") || s.ends_with(".dylib")))
            || (s.starts_with("swc_internal") && s.ends_with(".dll"))
        {
            return Ok(entry.path());
        }
    }

    Err(anyhow!("Could not find built plugin"))
}
/// Returns the path to the built plugin
Returns the path to the built plugin
Returns the path to the built plugin
fn build_plugin(dir: &Path) -> Result<PathBuf, Error> {
    {
        let mut cmd = Command::new("cargo");
        cmd.current_dir(dir);
        cmd.arg("build").stderr(Stdio::inherit());
        cmd.output()?;
    }
    for entry in fs::read_dir(&dir.join("target").join("debug"))? {
        let entry = entry?;
        let s = entry.file_name().to_string_lossy().into_owned();
        if (s.starts_with("libswc_internal") && (s.ends_with(".so") || s.ends_with(".dylib")))
            || (s.starts_with("swc_internal") && s.ends_with(".dll"))
        {
            return Ok(entry.path());
        }
    }
    Err(anyhow!("Could not find built plugin"))
}
fn build_plugin ( dir : & Path ) -> Result < PathBuf , Error > { { let mut cmd = Command :: new ( " " ) ; cmd . current_dir ( dir ) ; cmd . arg ( " " ) . stderr ( Stdio :: inherit ( ) ) ; cmd . output ( ) ? ; } for entry in fs :: read_dir ( & dir . join ( " " ) . join ( " " ) ) ? { let entry = entry ? ; let s = entry . file_name ( ) . to_string_lossy ( ) . into_owned ( ) ; if ( s . starts_with ( " " ) && ( s . ends_with ( " " ) || s . ends_with ( " " ) ) ) || ( s . starts_with ( " " ) && s . ends_with ( " " ) ) { return Ok ( entry . path ( ) ) ; } } Err ( anyhow ! ( " " ) ) }
Returns the path to the built plugin
Returns the path to the built plugin
dir
&Path