create missing dirs
authorRudolf Polzer <divVerent@alientrap.org>
Thu, 5 Aug 2010 10:08:29 +0000 (12:08 +0200)
committerRudolf Polzer <divVerent@alientrap.org>
Thu, 5 Aug 2010 10:08:29 +0000 (12:08 +0200)
misc/tools/cached-converter.sh

index 4d52563ec279e3290e88b3b216a11b9368056946..b1d393d7d6d7b4acba5aeddb9ef65448d9207778 100755 (executable)
@@ -46,6 +46,8 @@ cached()
        [ -z "$outfile2" ] || name2="$CACHEDIR/$method-$options/$sum-2.${outfile2##*.}"
        tempfile1="${name1%/*}/new-${name1##*/}"
        [ -z "$outfile2" ] || tempfile2="${name2%/*}/new-${name2##*/}"
+       mkdir -p "${outfile%/*}"
+       [ -z "$outfile2" ] || mkdir -p "${outfile2%/*}"
        if [ -f "$name1" ]; then
                ln "$name1" "$outfile1" 2>/dev/null || cp "$name1" "$outfile1"
                [ -z "$outfile2" ] || ln "$name2" "$outfile2" 2>/dev/null || cp "$name2" "$outfile2"