this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

✨ Check if ffmpeg and resvg are installed before building videos

authored by

Gwenn Le Bihan and committed by
Ewen Le Bihan
b6f1204e cdb14f3e

+18
+18
src/video.rs
··· 1 + use std::process; 1 2 use std::{ 2 3 cmp::min, 3 4 collections::HashMap, ··· 92 93 fn default() -> Self { 93 94 Self::new(Canvas::new(vec!["root"])) 94 95 } 96 + } 97 + 98 + fn is_binary_installed(binary: &str) -> bool { 99 + process::Command::new("which") 100 + .arg(binary) 101 + .output() 102 + .map(|output| output.status.success()) 103 + .unwrap_or(false) 95 104 } 96 105 97 106 impl<AdditionalContext: Default> Video<AdditionalContext> { ··· 675 684 workers_count: usize, 676 685 _preview_only: bool, 677 686 ) -> Result<()> { 687 + // Ensure resvg is installed 688 + if !is_binary_installed("resvg") { 689 + panic!("resvg is not installed. Please install it by running `cargo install resvg`."); 690 + } 691 + // Ensure ffmpeg is installed 692 + if !is_binary_installed("ffmpeg") { 693 + panic!("ffmpeg is not installed. Please install it."); 694 + } 695 + 678 696 let mut frame_writer_threads = vec![]; 679 697 let mut frames_to_write: Vec<(String, usize, usize)> = vec![]; 680 698