move mkdir -p

main
Bel LaPointe 2023-12-27 00:21:43 -05:00
parent ffb2c2bd34
commit 2071499feb
1 changed files with 2 additions and 1 deletions

View File

@ -1,12 +1,12 @@
use std::str::FromStr; use std::str::FromStr;
use core::cmp::Ordering; use core::cmp::Ordering;
use std::fs; use std::fs;
use std::path::Path;
pub fn clipify(input: &String) -> Result<Vec<String>, String> { pub fn clipify(input: &String) -> Result<Vec<String>, String> {
match inspect(input) { match inspect(input) {
Ok(inspection) => { Ok(inspection) => {
let output_d = format!("{}.d", input); let output_d = format!("{}.d", input);
fs::create_dir_all(&output_d).unwrap();
let ext = input.split(".").last().unwrap(); let ext = input.split(".").last().unwrap();
let mut result = vec![]; let mut result = vec![];
for i in 0..inspection.len() { for i in 0..inspection.len() {
@ -21,6 +21,7 @@ pub fn clipify(input: &String) -> Result<Vec<String>, String> {
} }
pub fn clip(output: &String, input: &String, content_span: ContentSpan) -> Result<(), String> { pub fn clip(output: &String, input: &String, content_span: ContentSpan) -> Result<(), String> {
fs::create_dir_all(Path::new(output).parent().unwrap()).unwrap();
match std::process::Command::new("ffmpeg") match std::process::Command::new("ffmpeg")
.args([ .args([
"-y", "-y",