Skip to content

Commit

Permalink
fixed temp file not being removed
Browse files Browse the repository at this point in the history
  • Loading branch information
iByteABit256 committed Apr 20, 2023
1 parent a36c121 commit 24583e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(())
}

Expand Down

0 comments on commit 24583e8

Please sign in to comment.