From 8465f288e6f1adb2ee817b1d9aa9180c0752f9f4 Mon Sep 17 00:00:00 2001 From: bgx <31708234+coltc50@users.noreply.github.com> Date: Tue, 18 Sep 2018 22:04:54 +0200 Subject: [PATCH] insert workdir option into comchap --- comchap | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/comchap b/comchap index 1109a74..518427a 100755 --- a/comchap +++ b/comchap @@ -30,6 +30,7 @@ deletelogo=true deletetxt=true verbose=false lockfile="" +workdir="" while [[ $# -gt 1 ]] do @@ -63,6 +64,10 @@ case $key in lockfile="${key#*=}" shift ;; + --work-dir=*) + workdir="${key#*=}" + shift + ;; *) break ;; @@ -107,11 +112,28 @@ outdir=$(dirname "$outfile") outextension="${outfile##*.}" -edlfile="${infile%.*}.edl" -metafile="${infile%.*}.ffmeta" -logfile="${infile%.*}.log" -logofile="${infile%.*}.logo.txt" -txtfile="${infile%.*}.txt" +if [[ ! -z "$workdir" ]]; then + case "$workdir" in + */) + ;; + *) + comskipoutput="--output=$workdir" + workdir="$workdir/" + ;; + esac +infileb=`basename "$infile"` +edlfile="$workdir${infileb%.*}.edl" +metafile="$workdir${infileb%.*}.ffmeta" +logfile="$workdir${infileb%.*}.log" +logofile="$workdir${infileb%.*}.logo.txt" +txtfile="$workdir${infileb%.*}.txt" +else +edlfile="$workdir${infile%.*}.edl" +metafile="$workdir${infile%.*}.ffmeta" +logfile="$workdir${infile%.*}.log" +logofile="$workdir${infile%.*}.logo.txt" +txtfile="$workdir${infile%.*}.txt" +fi if [ ! -f "$edlfile" ]; then $comskipPath --ini="$comskipini" "$infile"