pub fn update_output(
        &mut self,
        build: &BuildDetails,
        path: Option<PathBuf>,
        command: &Command,
    ) -> Result<()> {
        let name = build.get_name();
        let example = build.is_example();
        let release = build.is_release();

        let output = OutputInfo::new(path.clone());

        let opt = self.get_mut_artifact_detail(&name, release, example);
        let mut artifact = if let Some(artifact) = opt {
            artifact.clone()
        } else {
            ArtifactDetail::new()
        };

        match command {
            Command::Generate(_) => artifact.generate_output = Some(output),
            Command::Flash(_) => artifact.flash_output = Some(output),
            Command::Measure(_) => artifact.measure_output = Some(output),
            _ => return Err(anyhow!("Cannot store metadata for command: {:?}", &command)),
        }

        self.insert(&name, artifact, release, example);

        Ok(())
    }
/// Updates build output details of a command in the metadata.
///
/// * `build` - The build details
/// * `path` - The output path
/// * `command` - The command that was ran
Updates build output details of a command in the metadata.
Updates build output details of a command in the metadata .
pub fn update_output(
        &mut self,
        build: &BuildDetails,
        path: Option<PathBuf>,
        command: &Command,
    ) -> Result<()> {
        let name = build.get_name();
        let example = build.is_example();
        let release = build.is_release();
        let output = OutputInfo::new(path.clone());
        let opt = self.get_mut_artifact_detail(&name, release, example);
        let mut artifact = if let Some(artifact) = opt {
            artifact.clone()
        } else {
            ArtifactDetail::new()
        };
        match command {
            Command::Generate(_) => artifact.generate_output = Some(output),
            Command::Flash(_) => artifact.flash_output = Some(output),
            Command::Measure(_) => artifact.measure_output = Some(output),
            _ => return Err(anyhow!("Cannot store metadata for command: {:?}", &command)),
        }
        self.insert(&name, artifact, release, example);
        Ok(())
    }
pub fn update_output ( & mut self , build : & BuildDetails , path : Option < PathBuf > , command : & Command , ) -> Result < ( ) > { let name = build . get_name ( ) ; let example = build . is_example ( ) ; let release = build . is_release ( ) ; let output = OutputInfo :: new ( path . clone ( ) ) ; let opt = self . get_mut_artifact_detail ( & name , release , example ) ; let mut artifact = if let Some ( artifact ) = opt { artifact . clone ( ) } else { ArtifactDetail :: new ( ) } ; match command { Command :: Generate ( _ ) => artifact . generate_output = Some ( output ) , Command :: Flash ( _ ) => artifact . flash_output = Some ( output ) , Command :: Measure ( _ ) => artifact . measure_output = Some ( output ) , _ => return Err ( anyhow ! ( " " command ) ) , } self . insert ( & name , artifact , release , example ) ; Ok ( ( ) ) }
Updates build output details of a command in the metadata.
Updates build output details of a command in the metadata .
&mut self
build
&BuildDetails
path
Option<PathBuf>
command
&Command
&mut self
build
&BuildDetails
path
Option<PathBuf>
command
&Command