mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2026-10-22 22:32:08 +03:00
Check ffmpeg is in PATH
This commit is contained in:
1 parent
22133436b9
commit
5fa745975c
4 files changed
+152
-8
No files matched your search
+10
@@ -14,6 +14,7 @@ use log::LevelFilter;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
use std::process;
|
||||
use which::which;
|
||||
mod analyse;
|
||||
mod db;
|
||||
mod ffmpeg;
|
||||
@@ -93,6 +94,15 @@ fn main() {
|
||||
process::exit(-1);
|
||||
}
|
||||
|
||||
// Ensure ffmpeg is in PATH...
|
||||
match which("ffmpeg") {
|
||||
Ok(_) => { }
|
||||
Err(_) => {
|
||||
log::error!("'ffmpeg' was not found! Please ensure this in your PATH");
|
||||
process::exit(-1);
|
||||
},
|
||||
}
|
||||
|
||||
if !config_file.is_empty() {
|
||||
let path = PathBuf::from(&config_file);
|
||||
if path.exists() && path.is_file() {
|
||||
|
||||
Reference in new issue
Block a user