Skip to content

Commit

Permalink
Update path handling for ~ .
Browse files Browse the repository at this point in the history
  • Loading branch information
Spider committed Nov 8, 2023
1 parent 0359763 commit 709cdf7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,20 @@ fn main() {
)
.expect("Failed to set global default tracing subscriber");
}
let directory = matches
let path = matches
.get_one::<PathBuf>("input")
.expect("required")
.clone();

let audio_info_string = AudioInfo::generate_audio_info_from_path(directory);
let full_path = match fs::canonicalize(path) {
Ok(full_path) => full_path,
Err(e) => {
eprintln!("Error: {}", e);
std::process::exit(1);
}
};

let audio_info_string = AudioInfo::generate_audio_info_from_path(full_path);

if print {
print!("{:}", audio_info_string);
Expand Down

0 comments on commit 709cdf7

Please sign in to comment.