diff --git a/Cargo.lock b/Cargo.lock index f4cc98d..d27ce6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1103,7 +1103,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vivace" -version = "0.1.0" +version = "0.1.1" dependencies = [ "clap", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index e1783d2..517b1d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vivace" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 5609f62..299d0d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,9 @@ use std::{env, str::FromStr, process::Output}; use ytb_downloader::*; use clap::Parser; use parser::Args; -use log::info; +use log::{info,warn}; use std::process::Command; +use std::fs::remove_file; mod parser; @@ -117,6 +118,12 @@ async fn run(args: Args) -> Result<()> { convert(&temp_file, &outfile).chain_err(|| "Error while converting file")?; info!("Done."); + // Remove temp file + match remove_file(&temp_file) { + Ok(()) => info!("Temp file deleted."), + Err(_e) => warn!("Could not delete temp file."), + }; + Ok(()) }