From 6155e8de0cfd6117a4804c18a64b75d52e0ae21c Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 10 Oct 2016 14:30:51 -0600 Subject: Check directory exists before removal --- stylize_video.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'stylize_video.sh') diff --git a/stylize_video.sh b/stylize_video.sh index cb8698c..082fc9d 100644 --- a/stylize_video.sh +++ b/stylize_video.sh @@ -45,6 +45,9 @@ style_image="$2" style_dir=$(dirname "$style_image") style_filename=$(basename "$style_image") +if [ ! -d "./video_input" ]; then + mkdir ./video_input +fi temp_dir="./video_input/${content_filename}" # Create output folder @@ -81,4 +84,6 @@ echo "Converting image sequence to video. This should be quick..." $FFMPEG -v quiet -i ./video_output/frame_%04d.ppm ./video_output/${content_filename}-stylized.$extension # Clean up garbage -rm -rf "${temp_dir}" \ No newline at end of file +if [ -d "${temp_dir}" ]; then + rm -rf "${temp_dir}" +fi -- cgit v1.2.3-70-g09d2